Skip to content

Commit 304a0a9

Browse files
committed
servercontroller: terminate server if starting it failed for some reason. also increased the number of attempts to connect to it.
1 parent 03e8270 commit 304a0a9

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

atest/servercontroller.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,11 @@
2828
def start(interpreter=sys.executable, library='examplelib.py'):
2929
results = _get_result_directory()
3030
with open(join(results, 'server.txt'), 'w') as output:
31-
subprocess.Popen([interpreter, join(BASE, 'libs', library)],
32-
stdout=output, stderr=subprocess.STDOUT,
33-
env=_get_environ())
34-
if not test(attempts=10):
31+
server = subprocess.Popen([interpreter, join(BASE, 'libs', library)],
32+
stdout=output, stderr=subprocess.STDOUT,
33+
env=_get_environ())
34+
if not test(attempts=15):
35+
server.terminate()
3536
raise RuntimeError('Starting remote server failed')
3637

3738
def _get_result_directory():

0 commit comments

Comments
 (0)