Skip to content

Add docs for test_resumed_cancelled_handle_compute#6905

Closed
fjetter wants to merge 2 commits intodask:mainfrom
fjetter:docs_for_test_resumed_cancelled_handle_compute
Closed

Add docs for test_resumed_cancelled_handle_compute#6905
fjetter wants to merge 2 commits intodask:mainfrom
fjetter:docs_for_test_resumed_cancelled_handle_compute

Conversation

@fjetter
Copy link
Copy Markdown
Member

@fjetter fjetter commented Aug 18, 2022

Came up during review of #6699

@fjetter
Copy link
Copy Markdown
Member Author

fjetter commented Aug 18, 2022

I also added a minimal example using the WSM itself. It does not cover the exact same thing, particularly the scheduler interaction is not simulated in this minimal example which is why I would prefer keeping both. The WSM test is, however, much more straight forward



@pytest.mark.parametrize("fail", [True, False])
def test_executing_cancelled_fetch_executing(ws, fail):
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: This actually fails when using the ws_with_running_task fixture because we're not releasing a resource properly. Will try again after #6699

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you move this test to test_cancelled_state.py?
I'd rather have tests grouped by what they test, not by how they test it.
I already added a -m workerstate to pytest to run all WorkerState tests throughout the whole test suite (#6706) for this purpose.

@github-actions
Copy link
Copy Markdown
Contributor

Unit Test Results

See test report for an extended history of previous test failures. This is useful for diagnosing flaky tests.

       15 files  ±  0         15 suites  ±0   6h 30m 36s ⏱️ + 3m 45s
  3 002 tests +  2    2 900 ✔️  - 10       88 💤  - 1    4 +  3  10 🔥 +10 
22 260 runs  +14  21 122 ✔️  - 72  1 052 💤 +1  16 +15  70 🔥 +70 

For more details on these failures and errors, see this check.

Results for commit 9af7fca. ± Comparison against base commit 61fca1c.

Comment on lines +1312 to +1313
assert len(instructions) == 1
assert instructions[0] == Execute(key="x", stimulus_id="s1")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
assert len(instructions) == 1
assert instructions[0] == Execute(key="x", stimulus_id="s1")
assert instructions == [Execute(key="x", stimulus_id="s1")]

Comment on lines +1318 to +1319
assert len(instructions) == 1
assert isinstance(instructions[0], TaskErredMsg)
Copy link
Copy Markdown
Collaborator

@crusaderky crusaderky Aug 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
assert len(instructions) == 1
assert isinstance(instructions[0], TaskErredMsg)
assert instructions == [TaskErredMsg.match(key="x", stimulus_id="s6")]

Comment on lines +1326 to +1327
assert len(instructions) == 1
assert isinstance(instructions[0], TaskFinishedMsg)
Copy link
Copy Markdown
Collaborator

@crusaderky crusaderky Aug 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
assert len(instructions) == 1
assert isinstance(instructions[0], TaskFinishedMsg)
assert instructions == [TaskFinishedMsg.match(key="x", stimulus_id="s6")]

Copy link
Copy Markdown
Collaborator

@crusaderky crusaderky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cosmetic

@crusaderky
Copy link
Copy Markdown
Collaborator

Shouldn't the new test also factor in the wait_for_processing switch?

@fjetter fjetter closed this Jul 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants