Skip to content

Commit

Permalink
tests: simplify RedpandaService._for_nodes
Browse files Browse the repository at this point in the history
...use a single `map` instead of loops.
  • Loading branch information
jcsp committed Aug 11, 2022
1 parent 8a684c0 commit ea8f563
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions tests/rptest/services/redpanda.py
Original file line number Diff line number Diff line change
Expand Up @@ -695,12 +695,7 @@ def _for_nodes(self, nodes, cb: callable, *, parallel: bool):
node_futures = []
with concurrent.futures.ThreadPoolExecutor(
max_workers=len(nodes)) as executor:
for node in nodes:
f = executor.submit(cb, node)
node_futures.append((node, f))

for node, f in node_futures:
f.result()
list(executor.map(cb, nodes))

def start(self,
nodes=None,
Expand Down

0 comments on commit ea8f563

Please sign in to comment.