Repository navigation
chore(stryker): register 3 covering unit tests missing from tap.testFiles - #13357
Conversation
|
The |
|
Investigated — the RAYCAST doc-sync half is already fixed elsewhere, no further diff needed in this PR. Evidence, checked against
Landing commit: i.e. it dropped both the
So this PR's diff correctly stays package.json-only — the |
2c52d8c to
9512dfe
Compare
|
Holding this one rather than merging, for two reasons:
If you still want the concurrency change, open it on its own with a before/after measurement (wall time and peak RSS at a comparable load) and it gets judged on its own merits. Nothing here is wasted — the force-exit work you did is what is already in the tree. |
2fe8ef8 to
0d7cfcb
Compare
Two independent defects, both in the test/dev entrypoint layer.
1. `npm run test` never terminated. It was a hand-maintained copy of
`test:unit` that had drifted: it omitted `--test-force-exit` on BOTH
node invocations and dropped the trailing `&& npm run test:unit:serial`.
Per AGENTS.md ('Database Handles in Tests'), unreleased SQLite handles
make Node's native runner hang indefinitely — every sibling script
(`test:unit`, `test:unit:ci`, `test:unit:ci:shard`) already carried the
flag; only `test` did not. Measured on m1max at 84c6ad7, same suite
both arms: without the flag the runner was killed at the 420s ceiling
(exit 137, no summary line, 23 orphaned node processes); with it the
runner exited on its own in 419s leaving 1. `test` now delegates to
`test:unit` so the two cannot drift again, which also makes the serial
suite reachable from `npm run test` for the first time.
2. Removing the RAYCAST_* rows from ENVIRONMENT.md (#9) broke
check-env-doc-sync. `parseEnvExampleVars` matches `^#?\s*(VAR)=`, so it
counts COMMENTED-OUT vars: the four entries still sat at
.env.example:1263-1266 and became `envMissingDoc` drift the moment their
docs disappeared. The #9 verification only ran the fabricated-docs gate
and missed this one. The block is dead either way — it documents
open-sse/services/raycast.ts and scripts/raycast/usage-benchmark.mjs,
both deleted with the GPL-derived provider in cheaper-inference#11691, and no live code
reads the vars — so it is removed rather than re-documented.
envMissingDoc is now []. The remaining codeMissingEnv failure
(CURSOR_AGENT_BINARY, CURSOR_MAX_FRAME_BYTES, OMNIROOT) is pre-existing
drift on the base, absent from this diff, and left alone.
…iles check:mutation-test-coverage --strict fails identically on pristine release/v3.8.51 (f1e7148) with an empty diff — base debt blocking this PR. - combo-identical-error-streak.test.ts -> comboPredicates.ts - 13601-header-drop-count-surfaced.test.ts -> responseHeaders.ts - semantic-cache-no-truncated-writes.test.ts -> semanticCache.ts
0d7cfcb to
25c999d
Compare
CI attribution for run 35126101685Both red gates reproduce on pristine 1. Reproduced on pristine base Registering those 3 files in 2. Those shards run The shard failures are the symptom this PR exists to fix. On pristine base
Corroborating evidence that these are load/termination artifacts and not regressions: running the full unit suite (4587 files, ~34.6k tests) locally on pristine base vs. three separate PR branches, the same tests flip pass↔fail in both directions across runs of an identical, zero-diff commit:
Reproducing the numbers git checkout --detach f1e7148c1
node scripts/check/check-mutation-test-coverage.mjs --strict # gate 1, fails on base
export DISABLE_SQLITE_AUTO_BACKUP=true
node --max-old-space-size=8192 --import tsx/esm \
--import ./open-sse/utils/setupPolyfill.ts \
--import ./tests/_setup/isolateDataDir.ts \
--test --test-force-exit --test-concurrency=4 \
tests/unit/gen-budget-card-svg.test.ts # gate 2, hangs on baseNote: 6 test files ( |
…:unit The dedupe made `test` delegate to `test:unit`, but it also silently reverted the deliberate local concurrency cap from cheaper-inference#13187 ("cap local unit-test concurrency at 4 to avoid exhausting commit charge") back to 20. Measured on m1max (16 cores), same suite and same tree, only the flag differs: concurrency=20 -> 356 cancelled, 356 "event loop has already resolved" bailouts concurrency=4 -> 0 cancelled, 0 bailouts So 20 does not just slow the run down, it makes the runner abandon tests and still print a summary -- a false green. Restore 4; termination is preserved via delegation to test:unit, which already carries --test-force-exit.
The cheaper-inference#13187 batch commit (178d252) already gave `test` both `--test-force-exit` flags and the trailing `&& npm run test:unit:serial` step, so the delegation fix was redundant. It also broke tests/unit/test-serial-quarantine.test.ts, which asserts every parallel runner script ends with the serial step (base 4/4 -> head 3/4). package.json is now byte-identical to base; this PR is the stryker tap.testFiles fix only.
Scope reduction after rebase onto
|
test:unit concurrency |
cancelled | "event loop has already resolved" bailouts |
|---|---|---|
| 20 (this PR as pushed) | 356 | 356 |
| 4 (base / #13187) | 0 | 0 |
At 20, npm run test "terminates" by cancelling 356 tests — a false green, not a fix. Guard test on corresponding trees: base 4/4 pass, this branch pre-revert 3/4 (not ok 2 - todos os runners paralelos terminam com o passo serial).
2. RAYCAST env-doc sync — moot: ENVIRONMENT.md no longer exists on base.
git show origin/release/v3.8.51:ENVIRONMENT.md → path 'ENVIRONMENT.md' does not exist. Removed upstream while this PR was open, so the envMissingDoc it repaired cannot recur. check-env-doc-sync.mjs reports "✓ Env / docs contract is in sync" on pristine base — no repair needed.
Current diff: stryker.conf.json only (+3), which is still genuinely required.
Fast Quality Gates failed on 3 tests missing from tap.testFiles, reproducible on pristine base and absent from this diff's original scope:
3 covering unit test(s) across 3 module(s) are missing from stryker.conf.json tap.testFiles.
open-sse/services/combo/comboPredicates.ts + tests/unit/combo-identical-error-streak.test.ts
open-sse/handlers/chatCore/responseHeaders.ts + tests/unit/13601-header-drop-count-surfaced.test.ts
open-sse/handlers/chatCore/semanticCache.ts + tests/unit/semantic-cache-no-truncated-writes.test.ts
Registered all three; gate now ✓ No drift — every covering unit test is listed in tap.testFiles. Registered tests verified green individually (8 + 3 + 3 = 14 pass, 0 fail). Mutation-tested: reverting the 3 entries returns the gate to RED, restoring returns it GREEN.
package.json is now byte-identical to base. Ready for re-review; happy to have this closed instead if the maintainer prefers to track the stryker drift separately — the chunk belongs wherever it's easiest to land.
|
| Gate | Result |
|---|---|
Fast Quality Gates |
pass (was fail on the 3 missing tap.testFiles entries) |
Merge integrity, Docs Gates, No new ESLint warnings, Vitest, semgrep ×2, Change Classification |
pass |
Unit Tests fast-path 4/4 |
pass |
Unit Tests fast-path 1,2,3/4 |
fail — base debt, see below |
API Route Typecheck |
fail — base debt, see below |
Also confirmed resolved: todos os runners paralelos terminam com o passo serial (tests/unit/test-serial-quarantine.test.ts) is gone from the failure list now that package.json is back to base.
Remaining red gates are base debt — reproduced on pristine base with zero diff
Ran the exact 4 test files the failing assertions live in, on my head (7bda01936) and on pristine release/v3.8.51 (f1e7148c1) — identical 52/55 pass, 3 fail, same test names on both trees:
ℹ tests 55 / pass 52 / fail 3 <- head
ℹ tests 55 / pass 52 / fail 3 <- base, zero diff
✖ runAuthzPipeline allows dashboard sessions to reach DB health management API
✖ #2331 codex.ts still prioritizes modelEffort first in rawEffort chain
✖ direct translation calls have English messages
The fourth, OAuthModal renders the structured panel, passes in isolation on both trees — it only fails under CI shard CPU contention, same class as the rest of the shard noise.
API Route Typecheck is likewise base debt: src/lib/providerModels/modelDiscovery.ts:355 passes an untyped record.metadataProvenance into SyncedAvailableModel, whose metadataProvenance requires vertexDocs (made required by #12471). node scripts/check/check-api-typecheck.mjs fails identically on pristine f1e7148c1:
✗ src/lib/providerModels/modelDiscovery.ts TS2345 (baseline 0, live 1)
Neither is in this diff (package.json is byte-identical to base; stryker.conf.json +3 is the only change). Suggest those two be tracked at the base rather than fold unrelated fixes into this PR.
|
Thanks @patrykkopycinski — merging via the release merge-train. Validated in local merge-train (.claude/worktrees/merge-train-20260918-111718-suite.log) on the devbox @ train tip 7bb373fba5e241964c0ffb17bd03a804700839bb, boarded with 55 sibling PRs: typecheck:core, file-size, complexity, cognitive-complexity, changelog-integrity green; 747/747 changed-area node:test cases + 476/476 vitest green (fast parity mode — the full suite ran today on the release tip via the base-red train and runs again on the 3b train). Merged --admin per merge-gates §7. |
d073f1b
into
cheaper-inference:release/v3.8.51
…iles (cheaper-inference#13357) * fix(test): make npm run test terminate and restore RAYCAST env-doc sync Two independent defects, both in the test/dev entrypoint layer. 1. `npm run test` never terminated. It was a hand-maintained copy of `test:unit` that had drifted: it omitted `--test-force-exit` on BOTH node invocations and dropped the trailing `&& npm run test:unit:serial`. Per AGENTS.md ('Database Handles in Tests'), unreleased SQLite handles make Node's native runner hang indefinitely — every sibling script (`test:unit`, `test:unit:ci`, `test:unit:ci:shard`) already carried the flag; only `test` did not. Measured on m1max at 84c6ad7, same suite both arms: without the flag the runner was killed at the 420s ceiling (exit 137, no summary line, 23 orphaned node processes); with it the runner exited on its own in 419s leaving 1. `test` now delegates to `test:unit` so the two cannot drift again, which also makes the serial suite reachable from `npm run test` for the first time. 2. Removing the RAYCAST_* rows from ENVIRONMENT.md (cheaper-inference#9) broke check-env-doc-sync. `parseEnvExampleVars` matches `^#?\s*(VAR)=`, so it counts COMMENTED-OUT vars: the four entries still sat at .env.example:1263-1266 and became `envMissingDoc` drift the moment their docs disappeared. The cheaper-inference#9 verification only ran the fabricated-docs gate and missed this one. The block is dead either way — it documents open-sse/services/raycast.ts and scripts/raycast/usage-benchmark.mjs, both deleted with the GPL-derived provider in cheaper-inference#11691, and no live code reads the vars — so it is removed rather than re-documented. envMissingDoc is now []. The remaining codeMissingEnv failure (CURSOR_AGENT_BINARY, CURSOR_MAX_FRAME_BYTES, OMNIROOT) is pre-existing drift on the base, absent from this diff, and left alone. * chore(stryker): register 3 covering unit tests missing from tap.testFiles check:mutation-test-coverage --strict fails identically on pristine release/v3.8.51 (7339a9f) with an empty diff — base debt blocking this PR. - combo-identical-error-streak.test.ts -> comboPredicates.ts - 13601-header-drop-count-surfaced.test.ts -> responseHeaders.ts - semantic-cache-no-truncated-writes.test.ts -> semanticCache.ts * fix(test): keep the cheaper-inference#13187 concurrency-4 cap in test:unit The dedupe made `test` delegate to `test:unit`, but it also silently reverted the deliberate local concurrency cap from cheaper-inference#13187 ("cap local unit-test concurrency at 4 to avoid exhausting commit charge") back to 20. Measured on m1max (16 cores), same suite and same tree, only the flag differs: concurrency=20 -> 356 cancelled, 356 "event loop has already resolved" bailouts concurrency=4 -> 0 cancelled, 0 bailouts So 20 does not just slow the run down, it makes the runner abandon tests and still print a summary -- a false green. Restore 4; termination is preserved via delegation to test:unit, which already carries --test-force-exit. * revert(test): drop redundant test-script delegation The cheaper-inference#13187 batch commit (5d3c7d6) already gave `test` both `--test-force-exit` flags and the trailing `&& npm run test:unit:serial` step, so the delegation fix was redundant. It also broke tests/unit/test-serial-quarantine.test.ts, which asserts every parallel runner script ends with the serial step (base 4/4 -> head 3/4). package.json is now byte-identical to base; this PR is the stryker tap.testFiles fix only.
Registers the three unit tests that cover the mutated sources but were absent from
tap.testFiles, which is whatFast Quality Gateswas failing on.Added, at their correct sorted positions:
tests/unit/combo-identical-error-streak.test.tstests/unit/13601-header-drop-count-surfaced.test.tstests/unit/semantic-cache-no-truncated-writes.test.tsVerified individually green (8 + 3 + 3 = 14/14), and mutation-tested: removing the
three entries turns the gate red again, restoring them turns it green.
Scope reduction — both original fixes were already landed on base
This PR was opened against an older base. Rebasing onto
release/v3.8.51(f1e7148c1)showed both defects had already been fixed upstream, so both commits were dropped:
npm run testterminating — already fixed by fix(test): cap local unit-test concurrency at 4 to avoid exhausting commit charge #13187 (178d25250). Base'stestscript carries
--test-force-exiton both node invocations and already ends with&& npm run test:unit:serial. Nothing left to fix, and the delegation this PR addedadditionally reversed fix(test): cap local unit-test concurrency at 4 to avoid exhausting commit charge #13187's deliberate
--test-concurrency=4cap to 20 —measured on the same tree and suite, 20 produced 356 cancelled tests via
'Promise resolution is still pending but the event loop has already resolved'against 0 at concurrency 4. It also tripped
tests/unit/test-serial-quarantine.test.ts, which asserts every parallel runnerscript ends with the serial step (base 4/4 pass → branch 3/4).
ENVIRONMENT.mdno longer exists at the repo rootin base, and
check-env-doc-syncreports in-sync on pristinef1e7148c1.package.jsonis therefore byte-identical to base;stryker.conf.json+3 is the entire diff.Remaining red gates are base debt, not this diff
API Route Typecheck—src/lib/providerModels/modelDiscovery.ts:355passes anuntyped
record.metadataProvenanceintoSyncedAvailableModel, whosemetadataProvenancerequiresvertexDocs(required since fix(vertex): discover and route partner models correctly #12471). Reproduced onpristine
f1e7148c1with zero diff.Unit Tests fast-path1/2/3 of 4 — the failing assertions live in 4 test files;run on both my head and pristine base: identical 52/55 pass, 3 fail, same test names
on both trees.
Neither is touched by this diff.