Repository navigation
Commit 8aa5903
committed
Stop suites from starting and stopping each other's workers
scan_for_annotated_workers makes a TaskHandler start a worker for every
@worker_task/@WorkerTask in every imported test module -- both decorators
share one registry -- not just the calling suite's. In one CI run the
core bucket showed it plainly:
Discovered 8 annotated worker(s): ['async_basic_475f576a', ...,
'v2_fallback_task_a_84d0a6cf', 'v2_fallback_task_b_84d0a6cf']
Two different RUN_IDs: test_comprehensive_e2e's handler was running the
v2-fallback workers 13s before that suite started, and each suite's
teardown stopped the other's workers. A task whose worker disappears
sits in SCHEDULED until it ages out, which surfaces later as the opaque
"workflow expected to be COMPLETED, but received RUNNING" and as
"0 completed, 0 failed, 5 pending" -- the two failures that have been
taking down runs that are otherwise green.
Pass each suite the workers it actually drives, filtered from
get_registered_workers() by name, and turn scanning off. This is the
pattern test_async_lease_extension already uses, whose comment describes
this exact symptom.
test_workflow_execution keeps import_modules so the decorators still
register in spawned children; it just no longer adopts everything they
registered.1 parent 6baa86e commit 8aa5903
2 files changed
Lines changed: 28 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
132 | 142 | | |
| 143 | + | |
133 | 144 | | |
134 | | - | |
| 145 | + | |
135 | 146 | | |
136 | 147 | | |
137 | 148 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
22 | 25 | | |
23 | 26 | | |
24 | 27 | | |
| |||
47 | 50 | | |
48 | 51 | | |
49 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
50 | 63 | | |
51 | 64 | | |
52 | 65 | | |
53 | | - | |
| 66 | + | |
54 | 67 | | |
55 | 68 | | |
56 | 69 | | |
| |||
0 commit comments