Commit b1f499b
In test_shutdown_allows_1_export_to_finish, processor.shutdown()
interrupts the in-progress export via exporter.shutdown(). Depending on
thread scheduling, particularly on Windows and PyPy runners, the worker
thread can terminate before shutdown() returns, causing the intermediate
assertion assert worker_thread.is_alive() is True to fail intermittently.
Fix this by:
- Using time.monotonic() instead of time.time() for elapsed time.
- Removing the unstable intermediate is_alive() is True check.
- Waiting deterministically with worker_thread.join(timeout=1) before
asserting that the worker thread has terminated.
Fixes #5663
Assisted-by: Gemini 3.8 Flash
Co-authored-by: Lukas Hering <40302054+herin049@users.noreply.github.com>
1 parent 5321c60 commit b1f499b
1 file changed
Lines changed: 7 additions & 6 deletions
File tree
Lines changed: 7 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
274 | 274 | | |
275 | 275 | | |
276 | 276 | | |
277 | | - | |
| 277 | + | |
278 | 278 | | |
279 | | - | |
280 | | - | |
281 | 279 | | |
282 | | - | |
| 280 | + | |
283 | 281 | | |
284 | | - | |
285 | | - | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
286 | 287 | | |
287 | 288 | | |
288 | 289 | | |
| |||
0 commit comments