Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docs for test_resumed_cancelled_handle_compute #6905

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

fjetter
Copy link
Member

@fjetter fjetter commented Aug 18, 2022

Came up during review of #6699

@fjetter
Copy link
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
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
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
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
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
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 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
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 isinstance(instructions[0], TaskFinishedMsg)
assert instructions == [TaskFinishedMsg.match(key="x", stimulus_id="s6")]

Copy link
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
Collaborator

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

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.

None yet

2 participants