Repository navigation
Done
Labels
Description
🤖 Kit for jatmn
Status (refreshed 2026-11-24, main at b6d14bc)
Done (merged)
- #682 fixed the flakes from test: fix two flaky tests (bot '802' substring match on timestamp, Database Usage frontend timing) #661.
- #683 added CI lints for real-clock and fixed-sleep patterns, with an allowlist for existing cases.
- #695 fixed the guild-store writer lock wait and two flaky tests.
- #731 made staging push retries depend on the phase, not registry error text.
- #735, #736, #737 moved core, updater, runtime, API and bot tests to fixed clocks and signals.
- #780 fixed the bot launcher probe BrokenPipe flake (
crates/bot/tests/launcher_revision.rs).
Allowlist burn-down: tools/test-flake-allowlist.tsv is down from 483 rows / 637 findings when #683 landed to 413 rows / 529 occurrences (470 real-clock, 59 fixed-sleep).
Left to do
- Keep burning down the allowlist (the clock entries are most of it).
- Updater
controller_tests::api_role_serves_reads_while_a_superseded_launcher_clear_waits_for_the_writer: its allowlist row is gone, but no loop run has confirmed the flake is fixed. scripts/ci-workflow-test.mjs(around line 985) flake reported 2026-11-20: still open.- Post the final audit list here, then close.
The other load-sensitive tests from the test audit (TA-043 in #741) are tracked here.
Go through recent GitHub Actions runs on main and on PRs, and find tests that failed and then passed on a rerun or a later run without any code change.
Scope
- Look back over the last 30 days of runs (Validate / Checks: frontend, rust-core, rust-bot, rust-api).
- For each flaky test, record its name, the job it runs in, how often it fails, what the failure message says, and the likely cause (real clock, fixed sleeps, substring matches, test order, shared DB or ports, transaction timing).
- Fix each one at the root, for example with a fixed or fake clock, waiting on a condition instead of a fixed delay, exact matches, or isolated fixtures. Don't add retries or skips.
- Prove each fix by running the test in a loop locally.
This builds on #661 (the 802 substring match, the Database Usage freshness timing test, and the transaction timing flake), which can be folded into this work or fixed first.
Done when the audit list is posted here and every flaky test it found is either fixed or has its own issue.
Activity
jatmn commentedon Nov 18, 2026
🤖 Kit for jatmn
Scope addition: lints that stop new flaky tests
This idea comes from the
no-fixed-sleepandno-flake-maskingrules in interfere-inc/landmines. We're not adopting that package: it's Oxlint-only and built around Vitest/MSW, and it doesn't cover Rust.std::thread::sleep/tokio::time::sleepand wall-clock reads (SystemTime::now,Instant::now,chrono::Utc::now) inside#[test]/#[tokio::test]code. Tests should wait on a signal or channel, or use a paused or injected clock instead. Each existing hit goes either into a shrink-only allowlist or into a fix.setTimeout-based waits andDate.now()/new Date()without a fake clock.nextestretries, retry loops around assertions) or raises a timeout to make a test pass.The current flakes in #661 (the "2 min ago" vs "1 min ago" freshness check and the transaction timing flake) are exactly the cases these rules would catch, so fixing #661 should come first or go alongside this.
jatmn commentedon Nov 18, 2026
🤖 Kit for jatmn
Another flake for this audit:
controller_tests::ordinary_exit_after_idle_keeps_health_during_stalled_controlChecks / rust-coreon feat(webui): add public Privacy Policy and Terms of Service pages with data deletion requests #667 at 8425696 (run 44238031923, job 134578945818): assertion atcrates/updater/src/controller_tests.rs:4314,left: 1,right: 2.crates/updater(it only changescrates/api/src/web), so this is a timing flake in the launcher controller tests, not a regression from that PR.jatmn commentedon Nov 18, 2026
🤖 Kit for jatmn
Backlog note from #682 (merged): PR Reviewer flagged a P3 follow-up. The staging publish retry decides whether to retry by string-matching the registry's
unknown bloberror text. That's brittle if the message wording changes. Tracking it here with the other flaky-test follow-ups. It doesn't block anything.jatmn commentedon Nov 18, 2026
🤖 Fixer for jatmn
Two flaky tests from the 30-day CI audit in #683's PR body still need a real fix. I checked all five tests from that audit against the 9 fixes in #682. Three are already handled: #682 fixes
ordinary_exit_after_idle_keeps_health_during_stalled_controlanduserinfo_prefix_and_slash_hide_voice_the_caller_cannot_view.Members partial-import explanation opens inside narrow screenswas already fixed on main by #638 (#637). #682 (merged, closing #661) doesn't touch the two below, so I'm queuing them here. Both failed and then passed on a rerun of the same commit.tenant::tests::note_intent_retries_keep_one_entry_and_original_timestamp(cratejmodguard,src/tenant/tests.rs, rust-core lane)f9b4abb. Attempt 1 failed in Checks / rust-core and attempt 2 passed in Checks / rust-core.src/tenant/tests.rs:1085,called Result::unwrap() on an Err value: SQLite failure: database is locked.SQLITE_BUSYinstead of waiting. To fix it, I need to check how the fixture connection is configured compared with production, for example whether it has a busy timeout. Making the writes sequential would drop the concurrent idempotency coverage the test exists for.tests::launcher_periodic_tick_never_steals_a_live_foreign_fence_after_expiry(jmodguard-updater,jmodguard-launcherbin,crates/updater/src/main.rs, rust-core lane)d726f3c. Attempt 1 failed in Checks / rust-core after 20.5 s, and attempt 2 passed in Checks / rust-core.crates/updater/src/main.rs:3879,assertion failed: other.renew_launcher_fence().await.unwrap().These two are the follow-ups #683 leaves open on this issue.
jatmn commentedon Nov 18, 2026
🤖 Kit for jatmn
#683 merged. The flaky-test lints now run in the Dylint, frontend and contracts gates, and CI rejects new allowlist entries or higher counts. Keeping this issue open to burn down the inherited allowlist (637 existing Rust findings across 483 entries) recorded in #683.
fix(db): wait for the guild-store writer lock and fix two flaky tests (…
test: replace fixed sleeps with signals in core, updater and runtime …
jatmn commentedon Nov 20, 2026
🤖 Fixer for jatmn
Four draft PRs are open against this issue:
unknown blobtext. This is the P3 follow-up from test: fix flaky tests tracked in #661 #682.clockrows for core, updater, runtime and integration-tests drop from 37 rows / 58 findings to 19 / 38.sleeprows for the API drop from 36 findings to 13. It also lowers 9 APIclockrows that the rewrites cleared.sleeprows for the bot drop from 69 findings to 34. It also lowers 4 botclockrows.Local stress runs while that work was going on turned up three flakes in tests none of those PRs touch. All of them showed up with the machine's load average between 33 and 48.
controller_tests::api_role_serves_reads_while_a_superseded_launcher_clear_waits_for_the_writer(crates/updater)ci-preflight.sh --affected, with a 404 health reply after 20 s.sleeprow.scripts/ci-workflow-test.mjs:985("each retry must stall before its second page")crates/bot/tests/launcher_revision.rs:124get()health request failed with BrokenPipe in 8 of 160 runs of the base test binary (8 parallel copies, pinned to 2 CPUs). It hit 3 of 160 with test: replace fixed sleeps with signals in bot tests #737's binary.None of the four PRs fixes these.
test: use fixed clocks in core, updater and runtime tests
test: replace fixed sleeps with signals in bot tests (#737)
test: replace fixed sleeps with signals in API tests (#736)
fix(publish): retry staging pushes by phase, not registry error text (#…
test: use fixed clocks in core, updater and runtime tests (#735)
jatmn commentedon Nov 24, 2026
I fixed the late control result replay flake in draft #799. The draft has the before-and-after stress results.
27 remaining items
test(bot): use a paused clock origin in text spam detector tests (#1088)
jatmn commentedon Nov 30, 2026
PR #1088 merged at
d3f41d8. Ten in-memorytext_spam::testsdetector tests now take their origin from a paused Tokio clock, and their ten clock allowances are gone. The allowlist is down from 258 rows / 346 occurrences to 248 / 336. The changed tests passed 40 serial runs and 24 parallel runs, and the bot-scoped lint fails on exactly those ten tests when the old file is restored.The
scripts/ci-workflow-test.mjspagination flake (#820) and the updater launcher-clear loop confirmation (#820, #906, #1028) are already resolved onmain. The issue stays open for the remaining allowlist burn-down.jatmn commentedon Dec 5, 2026
fix-issue-queue claim 2026-12-05T17:27:32Z b9e8da268d2d01310968e0e73dd2d4fec67c293f7dfcfb50c20ab2872b68e987
test(api): check the delayed-body socket mode and wait for the SIGTER…
test(api): require the blocking-mode check and live lookups after expiry
test(api): correct the expired-save clock reset comment
test(api): drive writer expiry and waits with signals instead of real…
test(bot): probe the reservation lock before REST removal
test(bot): make logging timing and rate-limit capture deterministic (#…
test(bot): use one detector clock for image-spam windows and proofs
test(bot): use one detector clock for image-spam windows and proofs (#…
jatmn commentedon Dec 6, 2026
Final CI flake audit
All 15 PRs in this queue have merged. The allowlist had 168 entries covering 242 occurrences when the queue started. It now contains only its two header lines. Workspace-wide pinned Dylint returned zero warnings and errors on the exact tree merged as
af5f3ed. Allowlist on main at closureObserved CI failures
The initial audit records five named tests that failed and then passed on the same revision, their failure counts, symptoms and merged fixes. The November 18–30 follow-up covers 752 direct CI runs and 261 main publication runs. The logging delivery, updater startup receipt and late control result findings have merged fixes in #1078, #1020 and #799. The separately reported API authorization snapshot race was fixed in #1111. Initial audit · November follow-up
note_intent_retries_keep_one_entry_and_original_timestampuserinfo_prefix_and_slash_hide_voice_the_caller_cannot_viewMembers partial-import explanation opens inside narrow screenslauncher_periodic_tick_never_steals_a_live_foreign_fence_after_expiryordinary_exit_after_idle_keeps_health_during_stalled_controlsaturated_delivery_slots_retry_a_bounded_number_of_reconciled_payloadsapi_role_startup_receipts_log_one_info_line_per_unreachable_link_attemptlate_control_result_is_retrievable_and_replay_does_not_apply_twiceStillWaitingresponse in the follow-up window. #799 synchronizes with response publication.From November 30 at 00:00 UTC through December 5 at 19:22 UTC, the extension examined 299 direct CI and 86 publication runs. Failed, retried and cancelled runs were checked across attempts. Five failed jobs subsequently passed the same test on the same checkout. Counts below are observed failures in this interval.
a fragment-only preview stays read-only on the round trip through Administrationexit_code_child_retries_empty_and_partial_recordsstartup::tests::newer_guild_store_exits_instead_of_waitingan owner request recovers a partial create under the same ID and reports the last completionffd4caf. The companion test,an owner create whose saved request ID has closed starts a new request, lost its content element once in a publication run.401. The app uses the HTTP status for numeric auth failures, and the tests wait for the rendered error and refresh. Both cases passed 64 targeted executions in total. The hosted logs omit the original reference values, and the companion failure has no verified same-checkout recovery. Partial-create failure · Recovery · Companion failureThe two outstanding verification requests in the issue body were completed. The updater test
api_role_serves_reads_while_a_superseded_launcher_clear_waits_for_the_writerran 12 times with 20 split-request probes. The workflow pagination test ran 24 times, including 12 with delayed startup. Updater #906 · Pagination #820The frontend lint also reports the Firefox shutdown helper's five-second escalation timer. The helper waits on the real process exit/error signal, cancels the timer on exit, and sends SIGKILL only if termination stalls. The hosted frontend gate passed with this process watchdog present. Frontend job
The final audit interval ran from December 5 at 19:22 UTC through the merge of #1200 on December 6 at 00:32:49 UTC. It covered 27 direct CI runs and 13 main publication runs. All 13 publications passed on their first attempt. One release PR workflow recorded
action_requiredwith zero jobs. Two CI jobs failed when npm audit returned HTTP 403 before the Rust tests began. The integration job passed on a rerun of the same commit. API job · Integration job · Integration rerunThe later rust-api job on PR #1193 exposed one failure of
dual_process_readonly_api_delegates_backup_pause_and_restore_to_bot_writer. The integration fixture claimed the bot writer lease and launched an export while startup recovery still held the writer. The bot correctly refused the write pause, and the fixture failed its successful-export assertion. The same test passed on a later checkout. The rerun of the original checkout was cancelled before reaching the test. Failed export · Later passThe backup-export fixture now waits for the bot writer to finish startup recovery. Holding real recovery reproduced the write refusal. With the fix, a delayed recovery let the export proceed, and permanently held recovery failed at the fixture’s 180-second watchdog. All 22 hosted checks passed on the merged change. Backup fixture fix
The rust-bot test
old_or_unknown_launcher_child_is_refused_without_readiness_and_exits_cleanlyfailed once after the refused bot served health and received SIGTERM. The parent expected exit code 0 and observed a signal exit. Attempt 2 passed the same test in 0.179 seconds on the identical checkouta4d717d. The bot and runtime sources also match main atb6432b6. PR #1200 registers SIGTERM before publishing health or refusal. On the original process a controlled delay at registration reproduced signal 15. The fixed process exited 0, left the database and ready marker absent, and retained the expected HTTP responses. Both affected tests passed 20 serial and 12 contended runs each. The Unix signal was exercised on Linux. Windows fallback coverage was compile-only. Failure · Same-checkout recoveryMerged work and verification
#1193 removed the last 39 allowlist rows, covering 54 occurrences. #1194 removed 14 additional bot findings in activation and userinfo tests. All 12 affected tests passed 20 serial and 12 contended repetitions each. Final allowlist removal · Bot fixtures
The core database tests also had 27 inherited compiler findings outside the allowlist. The merged tests cover a renewal that expires while waiting for a connection, an applied update whose response arrives at its deadline, and rollback and recovery after both forms of snapshot cursor stall. All 22 hosted checks passed. These compiler findings are tracked separately from observed CI failures. Core database fixtures
The updater startup and migration fixes removed 56 inherited diagnostics in 14 tests. The updated launcher-clear case verifies that the first application read succeeds before writer activation and that the clear is persisted afterward. All 14 tests passed 20 serial and 12 contended runs each. All 21 hosted checks passed on the merged change. Updater fixtures
The two final updater PRs removed 47 child-exit and health findings and 37 reservation and selection findings. Main at
87759dehas the exact combined tree that passed full-workspace pinned Dylint with zero findings and all 187 updater tests. The allowlist is empty. The individual PR heads passed 544 and 480 focused test executions, respectively. Child exits and health · Reservations and selectionThe final SIGTERM fix passed all 22 hosted checks on
cbb1df0. The main publication triggered by that merge reused the PR validation. SIGTERM fix · Main publication