Merge pull request #11105

a16b3c8 functional_tests: remove unreachable code, kill process after timeout (SNeedlewoods)

ACKs: selsta, tobtoht, jpk68
This commit is contained in:
tobtoht
2026-08-19 11:22:45 +00:00
+7 -17
View File
@@ -161,24 +161,14 @@ for test in tests:
print('Stopping servers...')
kill()
# wait for exit, the poll method does not work (https://bugs.python.org/issue2475) so we wait, possibly forever if the process hangs
if True:
for p in processes:
# Wait up to 10 seconds for each process, then force termination.
for p in processes:
try:
p.wait(timeout=10)
except subprocess.TimeoutExpired:
print('Failed to stop process ' + str(p.pid) + ', killing it')
p.kill()
p.wait()
else:
for i in range(10):
n_returncode = 0
for p in processes:
p.poll()
if p.returncode:
n_returncode += 1
if n_returncode == len(processes):
print('All done: ' + string.join([x.returncode for x in processes], ', '))
break
time.sleep(1)
for p in processes:
if not p.returncode:
print('Failed to stop process')
if len(FAIL) == 0:
print('Done, ' + str(len(PASS)) + '/' + str(len(tests)) + ' tests passed')