Skip to content

Commit

Permalink
Test Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-janssen committed Nov 6, 2024
1 parent 3e824b0 commit 10ffbf3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/test_integration_pyiron_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def slowly_returns_dynamic(dynamic_arg):
return dynamic_arg

dynamic_dynamic = slowly_returns_dynamic()
executor = Executor(block_allocation=True)
executor = Executor(block_allocation=True, max_workers=1)
cloudpickle_register(ind=1)
dynamic_object = does_nothing()
fs = executor.submit(dynamic_dynamic.run, dynamic_object)
Expand Down Expand Up @@ -104,7 +104,7 @@ def slowly_returns_42():
self.assertIsNone(
dynamic_42.result, msg="Just a sanity check that the test is set up right"
)
executor = Executor(block_allocation=True)
executor = Executor(block_allocation=True, max_workers=1)
cloudpickle_register(ind=1)
fs = executor.submit(dynamic_42.run)
fs.add_done_callback(dynamic_42.process_result)
Expand Down Expand Up @@ -135,7 +135,7 @@ def returns_42():
dynamic_42.running,
msg="Sanity check that the test starts in the expected condition",
)
executor = Executor(block_allocation=True)
executor = Executor(block_allocation=True, max_workers=1)
cloudpickle_register(ind=1)
fs = executor.submit(dynamic_42.run)
fs.add_done_callback(dynamic_42.process_result)
Expand All @@ -159,7 +159,7 @@ def raise_error():
raise RuntimeError

re = raise_error()
executor = Executor(block_allocation=True)
executor = Executor(block_allocation=True, max_workers=1)
cloudpickle_register(ind=1)
fs = executor.submit(re.run)
with self.assertRaises(
Expand Down Expand Up @@ -189,7 +189,7 @@ def slowly_returns_dynamic():
return inside_variable

dynamic_dynamic = slowly_returns_dynamic()
executor = Executor(block_allocation=True)
executor = Executor(block_allocation=True, max_workers=1)
cloudpickle_register(ind=1)
fs = executor.submit(dynamic_dynamic.run)
self.assertIsInstance(
Expand Down Expand Up @@ -218,7 +218,7 @@ def slow():
return fortytwo

f = slow()
executor = Executor(block_allocation=True)
executor = Executor(block_allocation=True, max_workers=1)
cloudpickle_register(ind=1)
fs = executor.submit(f.run)
self.assertEqual(
Expand Down
2 changes: 2 additions & 0 deletions tests/test_local_executor_future.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ def submit():
# Executor only exists in this scope and can get garbage collected after
# this function is exits
future = InteractiveExecutor(
max_workers=1,
executor_kwargs={},
spawner=MpiExecSpawner,
).submit(slow_callable)
Expand Down Expand Up @@ -108,6 +109,7 @@ def run(self):
self.running = True

future = InteractiveExecutor(
max_workers=1,
executor_kwargs={},
spawner=MpiExecSpawner,
).submit(self.return_42)
Expand Down
1 change: 1 addition & 0 deletions tests/test_shell_interactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ def test_execute_single_task(self):
def test_shell_interactive_executor(self):
cloudpickle_register(ind=1)
with Executor(
max_workers=1,
init_function=init_process,
block_allocation=True,
) as exe:
Expand Down

0 comments on commit 10ffbf3

Please sign in to comment.