Skip to content

Commit 674119e

Browse files
authored
Nemesis: fix stucking perform_checks (#21548)
1 parent 525bcce commit 674119e

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

ydb/tests/library/nemesis/remote_execution.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -54,23 +54,23 @@ def wait_timeout(process, timeout):
5454
def execute_command_with_output_on_hosts(list_of_hosts, command, per_host_timeout=60, username=None):
5555
full_output = []
5656
full_retcode = 0
57-
pool = futures.ProcessPoolExecutor(8)
58-
fs = []
59-
for host in list_of_hosts:
60-
fs.append(
61-
pool.submit(
62-
execute_command_with_output_single_host,
63-
host, command,
64-
timeout=per_host_timeout,
65-
username=username
57+
with futures.ProcessPoolExecutor(8) as pool:
58+
fs = []
59+
for host in list_of_hosts:
60+
fs.append(
61+
pool.submit(
62+
execute_command_with_output_single_host,
63+
host, command,
64+
timeout=per_host_timeout,
65+
username=username
66+
)
6667
)
67-
)
6868

69-
for f in fs:
70-
retcode, output = f.result()
71-
if retcode:
72-
full_retcode = retcode
73-
full_output.extend(output)
69+
for f in fs:
70+
retcode, output = f.result()
71+
if retcode:
72+
full_retcode = retcode
73+
full_output.extend(output)
7474
return full_retcode, full_output
7575

7676

0 commit comments

Comments
 (0)