Commit b4662b2
committed
Fix race condition in celery system integration tests
Celery stores the task result before firing the task_success signal.
This means result.get() can return before the success handler runs,
causing the mock context to exit and the second update_task_safe call
to hit the real function instead of the mock.
Add _wait_for_mock_calls() to poll until the expected call count is
reached before exiting the mock context.1 parent 4564a2e commit b4662b2
1 file changed
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
29 | 42 | | |
30 | 43 | | |
31 | 44 | | |
| |||
71 | 84 | | |
72 | 85 | | |
73 | 86 | | |
| 87 | + | |
74 | 88 | | |
75 | 89 | | |
76 | 90 | | |
| |||
102 | 116 | | |
103 | 117 | | |
104 | 118 | | |
| 119 | + | |
105 | 120 | | |
106 | 121 | | |
107 | 122 | | |
| |||
0 commit comments