Skip to content

Commit

Permalink
Fix flaky session and thread_runner tests (#4419)
Browse files Browse the repository at this point in the history
* Try fix flaky session test

Signed-off-by: Merel Theisen <[email protected]>

* Try change test with mocking

Signed-off-by: Merel Theisen <[email protected]>

* Change logs property

Signed-off-by: Merel Theisen <[email protected]>

* Fix dict access

Signed-off-by: Merel Theisen <[email protected]>

* Use dict only for flaky test

Signed-off-by: Merel Theisen <[email protected]>

* Change number of workers

Signed-off-by: Merel Theisen <[email protected]>

* Clean up

Signed-off-by: Merel Theisen <[email protected]>

* Add other flaky test fix too

Signed-off-by: Merel Theisen <[email protected]>

* Try fix flaky iteration

Signed-off-by: Merel Theisen <[email protected]>

* remove redundant list conversion

Signed-off-by: Merel Theisen <[email protected]>

* Modify list differently

Signed-off-by: Merel Theisen <[email protected]>

* Try rename variables

Signed-off-by: Merel Theisen <[email protected]>

* See what happens

Signed-off-by: Merel Theisen <[email protected]>

* Set workers to 1

Signed-off-by: Merel Theisen <[email protected]>

---------

Signed-off-by: Merel Theisen <[email protected]>
  • Loading branch information
merelcht authored Jan 16, 2025
1 parent 1ed504c commit 5e81f54
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/framework/session/test_session_extension_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ def test_before_and_after_node_run_hooks_sequential_runner(
def test_on_node_error_hook_parallel_runner(self, mock_session, logs_listener):
with pytest.raises(ValueError, match="broken"):
mock_session.run(
runner=ParallelRunner(max_workers=2), node_names=["node1", "node2"]
runner=ParallelRunner(max_workers=1), node_names=["node1", "node2"]
)

on_node_error_records = [
Expand Down
2 changes: 1 addition & 1 deletion tests/runner/test_thread_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ def test_stricter_suggest_resume_scenario(
test_pipeline += modular_pipeline([nodes[name]._copy(func=exception_fn)])

with pytest.raises(Exception, match="test exception"):
ThreadRunner().run(
ThreadRunner(max_workers=1).run(
test_pipeline,
persistent_dataset_catalog,
hook_manager=_create_hook_manager(),
Expand Down

0 comments on commit 5e81f54

Please sign in to comment.