Commit 0e9baaa
authored
test: Add missing tests for reject method (#328)
# Description
This update addresses the need to improve test coverage for the `reject`
method in `TaskUpdater`. While basic tests for the `reject` method
already existed, this PR adds a crucial test case to handle race
conditions, ensuring the reliability and robustness of the task
rejection functionality.
**Changes:**
* Added `test_reject_concurrently_with_complete` to
`tests/server/tasks/test_task_updater.py`. This test simulates a race
condition by calling `reject()` and `complete()` concurrently on the
same task.
* It verifies that only one of the terminal state updates succeeds and
that only one event is sent, preventing inconsistent states.
**Value:**
* Improves test coverage by testing for race conditions.
* Ensures the reliability and consistency of the `TaskUpdater` when
multiple terminal state updates are attempted simultaneously.1 parent 0756d23 commit 0e9baaa
1 file changed
+30
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
535 | 535 | | |
536 | 536 | | |
537 | 537 | | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
0 commit comments