ci: test job flakes intermittently (transient failures, HEAD is green) #515

Closed
opened 2026-07-08 19:42:20 +00:00 by kert · 1 comment
Owner

The ci.yml test job (pytest -x --cov=src --cov-fail-under=99 -q -n auto) fails intermittently — the same suite passes on superset commits.

Observed (run / commit / test-job result):

  • #528 3c835e9 fail; #558 cc6feca pass; #561 c7ea28d pass
  • #564 3760541 fail; #567 b21b1ae fail
  • #569 c1c51d6 pass; #571 90651ff pass ← current HEAD green

c1c51d6/90651ff contain a superset of 3760541/b21b1ae changes, so those failures were not code regressions. Other unrelated commits (3edde5a, a94d3d4) show the same flakiness.

Impact: false-positive CI-failure issues (auto-filer noise); erodes trust in the gate.

Likely causes to investigate: pytest-xdist worker crash/OOM/timeout under -n auto on the runner; a nondeterministic test; coverage-combine races (parallel=true).

Options: capture per-worker logs on failure; add a single automatic rerun for the test job; pin worker count; quarantine any test found nondeterministic.

The `ci.yml` `test` job (`pytest -x --cov=src --cov-fail-under=99 -q -n auto`) fails **intermittently** — the same suite passes on superset commits. Observed (run / commit / test-job result): - #528 `3c835e9` fail; #558 `cc6feca` pass; #561 `c7ea28d` pass - #564 `3760541` **fail**; #567 `b21b1ae` **fail** - #569 `c1c51d6` **pass**; #571 `90651ff` **pass** ← current HEAD green `c1c51d6`/`90651ff` contain a superset of `3760541`/`b21b1ae` changes, so those failures were not code regressions. Other unrelated commits (`3edde5a`, `a94d3d4`) show the same flakiness. **Impact:** false-positive CI-failure issues (auto-filer noise); erodes trust in the gate. **Likely causes to investigate:** pytest-xdist worker crash/OOM/timeout under `-n auto` on the runner; a nondeterministic test; coverage-combine races (`parallel=true`). **Options:** capture per-worker logs on failure; add a single automatic rerun for the test job; pin worker count; quarantine any test found nondeterministic.
kert added the qualityci labels 2026-07-08 19:42:20 +00:00
Author
Owner

Fixed in 9b58e2dfb2. The ci test job now preinstalls the duckdb sqlite extension before pytest, so the per-worker INSTALL sqlite calls in tests/zot/test_duck.py become no-ops instead of racing the extension-file rename in ~/.duckdb ('Could not remove file ... sqlite_scanner'). The flake hit runs 584, 591, and 600; first post-fix test run is green.

Fixed in https://git.fhirworx.io/homelab/stack/commit/9b58e2dfb2646b0e8f0eace4b2939657c03518e1. The ci test job now preinstalls the duckdb sqlite extension before pytest, so the per-worker `INSTALL sqlite` calls in tests/zot/test_duck.py become no-ops instead of racing the extension-file rename in ~/.duckdb ('Could not remove file ... sqlite_scanner'). The flake hit runs 584, 591, and 600; first post-fix test run is green.
kert closed this issue 2026-07-10 18:37:33 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: homelab/stack#515