Commit d37666d
committed
PYTHON-5784 Cover threaded PeriodicExecutor exception path via synchro
Consolidate the target-exception test into the synchro'd source so both
AsyncPeriodicExecutor and the threaded PeriodicExecutor are covered from a
single source, and delete the async-only test file.
Why this reverses the async-only split from 3340959: that commit carved the
exception test out into test_async_periodic_executor.py to dodge the noisy
traceback an uncaught exception prints via threading.excepthook on the
background thread. But the two _run loops handle the exception differently --
the threaded version additionally takes the lock and sets _thread_will_exit,
which feeds the join-on-reopen path in open(). The async test therefore did
not cover that sync-only branch, leaving a real gap (also flagged by Copilot).
Rather than maintain two near-identical hand-written tests (which cuts against
the synchro direction this PR has otherwise followed), the test now lives in
the async source with an `if _IS_SYNC:` branch that swaps threading.excepthook
to a no-op for the threaded case. Verified the generated sync test passes
15/15 with no flakiness or stderr noise, which confirms the path is testable
and there was no real reason to keep it async-only.1 parent ea0db63 commit d37666d
4 files changed
Lines changed: 70 additions & 49 deletions
File tree
- test
- asynchronous
- tools
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
145 | 180 | | |
146 | 181 | | |
147 | 182 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
145 | 180 | | |
146 | 181 | | |
147 | 182 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
193 | | - | |
194 | 193 | | |
195 | 194 | | |
196 | 195 | | |
| |||
0 commit comments