You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Run non-TF fork tests before TF fork tests so the TF wedge can't mask them
The pt/onnx fork tests landed in the same serial -n 0 fork lane as the
TF fork tests. Because a fork-after-TensorFlow wedge kills the whole -n 0
process (that is why the lane is -n 0), and perch_v2 sorts before v3_0,
the intermittent TF wedge killed the lane before the pt/onnx fork tests
ran -- so the very tests meant to prove fork works without TensorFlow
never executed (observed in run 30630301430: fork[pt]/fork[onnx] never
ran; forkserver/spawn passed in the general lane).
Give the deadlock-free non-TF fork tests a "fork_nontf" marker and run
them first in their own process, ahead of the TF fork tests. A wedge in
the TF lane can no longer stop them from recording a result. They keep
the "fork" marker too, so the parallel general lane still excludes them
(forking after TF is loaded there would deadlock).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: pyproject.toml
+17-5Lines changed: 17 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -208,6 +208,7 @@ markers = [
208
208
"repro: tests requiring exact package versions to reproduce results",
209
209
"no_tf: tests for the TensorFlow-free surface, run when TF is absent (e.g. Python 3.14)",
210
210
"fork: tests that force the fork start method; run in a dedicated serial (-n 1) lane in a fresh process so a fork-after-TensorFlow deadlock cannot wedge the parallel general-phase workers (the library itself defaults to spawn, see birdnet.core.start_method)",
211
+
"fork_nontf: fork tests for non-TensorFlow backends (pt/onnx), which are deadlock-free; run in their own serial invocation BEFORE the TF fork tests so the TF tests' intermittent fork-after-TensorFlow wedge cannot stop them from proving fork works without TensorFlow (also carry `fork` so the general lane still excludes them)",
211
212
]
212
213
213
214
[tool.ruff]
@@ -285,7 +286,12 @@ commands =
285
286
# with the worker, and the orphaned child keeps the worker's execnet socket open
286
287
# so the controller sits blind until the watchdog's idle deadline. In-process,
287
288
# the timeout report lands in the log and the run ends at the test timeout.
288
-
pytest -m "not repro and not load_model and fork and not litert and not gpu" -n 0
289
+
# The non-TF (pt/onnx) fork tests run first in their own invocation: they are
290
+
# deadlock-free, and a fresh process means the TF fork tests' intermittent wedge
291
+
# (which kills the rest of its own -n 0 run) cannot stop them from recording a
292
+
# result. See the `fork_nontf` marker.
293
+
pytest -m "not repro and not load_model and fork and fork_nontf and not litert and not gpu" -n 0
294
+
pytest -m "not repro and not load_model and fork and not fork_nontf and not litert and not gpu" -n 0
289
295
pytest -m "not repro and not load_model and fork and litert and not gpu" -n 0
290
296
# build and check package
291
297
# note `python -m build` uses the isolated build folder which results in import error:
@@ -302,8 +308,11 @@ commands =
302
308
pytest -m "not load_model and (not litert and not gpu and not fork)" -n auto
303
309
# run litert tests including repro tests
304
310
pytest -m "not load_model and litert and not fork" -n auto
305
-
# fork tests isolated + serial (see the `fork` marker and conftest.py)
306
-
pytest -m "not load_model and fork and not litert and not gpu" -n 0
311
+
# fork tests isolated + serial (see the `fork` marker and conftest.py).
312
+
# Non-TF (pt/onnx) fork tests run first in their own process so the TF fork
313
+
# tests' intermittent wedge cannot stop them recording a result (see fork_nontf).
314
+
pytest -m "not load_model and fork and fork_nontf and not litert and not gpu" -n 0
315
+
pytest -m "not load_model and fork and not fork_nontf and not litert and not gpu" -n 0
307
316
pytest -m "not load_model and fork and litert and not gpu" -n 0
308
317
# gpu tests are not supported to be run with repro environment
309
318
pyproject-build -o dist/
@@ -328,8 +337,11 @@ commands =
328
337
pytest -m "not repro and not load_model and (not litert and not gpu and not fork)" -n auto --cov=src/birdnet --cov-append --cov-report=
329
338
pytest -m "not repro and not load_model and litert and not fork" -n auto --cov=src/birdnet --cov-append --cov-report=
330
339
pytest -m "not repro and not load_model and gpu" -n 1 --cov=src/birdnet --cov-append --cov-report=
331
-
# fork tests isolated + serial (see the `fork` marker and conftest.py)
332
-
pytest -m "not repro and not load_model and fork and not litert and not gpu" -n 0 --cov=src/birdnet --cov-append --cov-report=
340
+
# fork tests isolated + serial (see the `fork` marker and conftest.py).
341
+
# Non-TF (pt/onnx) fork tests run first in their own process so the TF fork
342
+
# tests' intermittent wedge cannot stop them recording a result (see fork_nontf).
343
+
pytest -m "not repro and not load_model and fork and fork_nontf and not litert and not gpu" -n 0 --cov=src/birdnet --cov-append --cov-report=
344
+
pytest -m "not repro and not load_model and fork and not fork_nontf and not litert and not gpu" -n 0 --cov=src/birdnet --cov-append --cov-report=
333
345
pytest -m "not repro and not load_model and fork and litert and not gpu" -n 0 --cov=src/birdnet --cov-append --cov-report=
0 commit comments