Repository navigation
test: deflake spawn/election assertions under parallel load - #103
Merged
Merged
Conversation
relay-lifecycle e2e was left on vitest defaults when the supervisor-loop deflake landed: probeTimeoutMs 100, election waitFor 5 s and no describe timeout override — so the default 5 s test timeout killed it under parallel-suite load (CI run 43907126160: timed out at 5 s, actual 7994 ms). supervisor-loop still flaked twice after its bump (a 23 s run exceeded the 20 s describe budget). - relay-lifecycle: describe timeout 20 s, probeTimeoutMs 1 s, election waitFor 10 s — level with supervisor-loop. - supervisor-loop: describe timeout 30 s, election waitFor 15 s. - Both election describes get retry: 1 as a bounded second chance for peak-load scheduling stalls; afterEach closes supervisors and removes temp roots, so a retried attempt starts clean. Production code untouched; codex-probe already carries 15 s/20 s deadlines. Evidence: 10 consecutive local pnpm verify runs green (108 files / 949 tests each); CI evidence linked in #13 from this PR.
Owner
Author
Review (dev) — ACCEPTTest-only, exactly the approved plan. The diagnosis holds: the previous deflake wave covered
Verified independently: 4/4 on the two touched suites in a detached worktree; author's DoD evidence: 10 consecutive full
|
This was referenced Nov 17, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Проблема
Flaky election-тесты под параллельной нагрузкой. Хронология по #13:
relay-lifecycle«preserves the conversation and re-elects one owner» — 4 падения за 2026-11-16 (CI PR #87, #97, #98 attempt 1: таймаут 5s → факт 7994ms; + локальный прогон),supervisor-loopelection — 2 падения.Диагноз (по коду)
Прошлый дефлак поднял таймауты только в
test/relay/supervisor-loop.test.ts.test/e2e/relay-lifecycle.test.tsостался на дефолтах:probeTimeoutMs: 100, electionwaitFor5s и без describe/test timeout — дефолтный vitest 5s. Под 106+ параллельными воркерами spawn relay (SQLite open + HTTP listen + election) не укладывается в 5s → точное совпадение с CI-фактом «5s → 7994ms».supervisor-loopпосле поднятия до 20s всё ещё пробивался пиковой нагрузкой (наблюдавшийся прогон 23s).Изменения (только test/, production-код и supervisor loop не тронуты)
relay-lifecycle.test.ts: describetimeout: 20_000,probeTimeoutMs: 100 → 1_000, electionwaitFor5s → 10s — вровень с supervisor-loop.supervisor-loop.test.ts: describetimeout: 20_000 → 30_000, electionwaitFor10s → 15s.retry: 1— bounded retry из скоупа issue;afterEachзакрывает supervisors и чистит temp-roots, повтор стартует с чистого листа.codex-probeне тронут: 15s/20s deadlines уже в main.Evidence по DoD
pnpm verify— все зелёные (каждый: format + import-check + typecheck + 108 файлов / 949 тестов + build), без retry и исключений, на коммите этой ветки (база e0f36b1, включает feat: credential re-read self-heal and relative projectRoot in generated configs (UX 2) #99).Closes #13.