Repository navigation
fix(test): restore the two checks #8573 left red on main - #8592
XiaoBinGan wants to merge 2 commits into
Conversation
7bcefea ("test: strengthen and prune audited test coverage", morluto#8573) landed 16 files that do not satisfy `oxfmt --check`, so `npm run format:check` fails on main itself and on every PR whose merge ref includes it. Apply `oxfmt .` to exactly those 16 files; no other file is touched. The diff is line wrapping, blank-line, and quote placement only - no behaviour, assertion, fixture value, or test name change. Verified on this branch: `npx oxfmt --check .` exits 0, both changed scripts pass `node --check`, and `node scripts/run-typescript.mjs --noEmit` exits 0.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
[Low impact] The reviewed changes appear safe to merge. SummaryRestores formatting across 16 files and extends the fake Inspector server’s idle connection timeout.
Reviews (4) · Last reviewed commit: "fix(test): keep the fake Inspector's dis..." · Reviewed by Greptile |
3420047 to
9909a1e
Compare
|
Left a note on #8596: its remaining Once both are in, |
`tests/boundary/mcp/javascriptRuntimeObservationMcp.test.ts` fails on main at
the direct-observation assertion with `endpoint_unreachable` /
`ECONNRESET`, so the second CDP connection never opens and the case stops
before it can compare the two evidence IDs.
The cause is not the observation path. The first `get_evidence_bundle` call
in a process - which that test now performs before the direct observation -
spends ~8.4s compiling the tool output schema inside the MCP client. Measured:
BUNDLE-CALL 1 ms= 8490
BUNDLE-CALL 2 ms= 1
setInterval(100ms) ticks during call 1: 0
`node --cpu-prof` attributes the time to `@modelcontextprotocol/client`'s Ajv
provider (`addNames` 2.3s, `compileSchema` 1.0s, plus codegen), so the event
loop is blocked synchronously, not waiting on I/O.
The fake Inspector's in-process HTTP server keeps Node's 5s keep-alive
default. While the loop is blocked that timeout expires, the server retires
the pooled discovery socket, and the provider's next CDP upgrade reuses the
retired socket and is reset.
Evidence that this is the mechanism rather than the assertions:
- replacing the block with a synchronous 8s spin reproduces the failure (2/2);
- replacing it with async 6s / 10s / 15s delays does not (5/5 pass);
- the fixture's CDP endpoint and WebSocket URL both answer correctly right
before the direct observation, so discovery state is intact.
Raise the fixture server's keep-alive window so an in-process caller that
blocks the loop cannot retire a socket a later caller still holds. The fake
is not modelling an idle-connection policy, so it has no reason to enforce
Node's default there.
The MCP case now passes 3/3 for three consecutive runs. It fails 4/4 on
unmodified main. The other five files that use this fixture are unchanged: the
two that still fail (`javascriptRuntimeObservation.test.ts`,
`javascriptRuntimeUnresolvedTarget.test.ts`) fail identically with and without
this change, so they are unrelated.
|
Updated: this branch now carries the two #8573 regressions I can fix here — the 16-file formatter breakage and the MCP fixture keep-alive. #8609 is closed as folded in; keeping them separate just deadlocked both, since each PR's merge ref inherits every I left the third one (the Frida fixture path) out, because that's #8595 / #8596 and it's your call which one takes it. Concretely, on this branch If you'd rather have a single PR that fixes all three, say so and I'll add the Frida fixture line here and you can close #8596 instead. I'm not going to guess which you prefer. |
|
I verified the combined effect of this PR's exact changed files ( Details and exact source hashes are in my #8596 integration note. This is not an upstream merge, full sharded CI, or a human-readiness attestation; it just supplies independent evidence for the maintainer's ordering/consolidation decision. |
|
2026-11-02 paired validation (independent, Codex-assisted). I applied the exact #8592
Additional pre-existing fixture ordering race found under coverage: The following test-only barrier preserves the original count/cause/cleanup assertions. It passes the delayed control and all9 existing file cases; no production change or timeout increase. This is a proposal for review, not full qualification or a competing PR: diff --git a/tests/process-global/cutterDescriptorLifetime.test.ts b/tests/process-global/cutterDescriptorLifetime.test.ts
--- a/tests/process-global/cutterDescriptorLifetime.test.ts
+++ b/tests/process-global/cutterDescriptorLifetime.test.ts
@@ -228,6 +228,10 @@
fault.root = root;
const controller = new AbortController();
const reason = new Error("cancel after the first descriptor failure");
+ let firstClose!: () => void;
+ const firstClosing = new Promise<void>((resolve) => {
+ firstClose = resolve;
+ });
let entered!: () => void;
let release!: () => void;
const waiting = new Promise<void>((resolve) => {
@@ -237,7 +241,10 @@
release = resolve;
});
fault.onClose = async (handle) => {
- if (handle === fault.handles[0]) return;
+ if (handle === fault.handles[0]) {
+ firstClose();
+ return;
+ }
entered();
await gate;
};
@@ -247,7 +254,7 @@
.catch((cause: unknown) => cause);
try {
await awaitAcknowledgement(
- waiting,
+ Promise.all([waiting, firstClosing]).then(() => undefined),
reading,
"peer descriptor finalization",
);The remaining original shards/full combined qualification were not completed. My extra local shard4 also exposed an incomplete diagnostic Git snapshot ( |
|
@jaelliot @SII-YDD — I owe you both a real reply. This PR was closed while I was still working through your notes, and I never acknowledged them. That is my miss, not yours. @jaelliot — your isolated fork-only tree from @SII-YDD — your paired validation on
You were also honest about the gaps — the remaining shards, the Both of you did verification work on a PR that was not yours to land. Thank you. |
Summary
7bcefead6("test: strengthen and prune audited test coverage", #8573) leftmainred inStatic checksand in the test shards. Every PR whose merge ref includes it inherits the failures even when its own diff is clean, so no PR can go green until this is fixed.Two independent regressions from that commit, both restored here:
oxfmt --check, sonpm run format:checkfails onmainitself.get_evidence_bundlecall totests/boundary/mcp/javascriptRuntimeObservationMcp.test.tsbefore its direct-observation assertion. The first such call in a process spends ~8.4s compiling the tool output schema inside the MCP client, blocking the loop synchronously. The fake Inspector's in-process HTTP server keeps Node's 5s keep-alive default, retires the pooled discovery socket during that block, and the provider's next CDP upgrade reuses the retired socket and is reset —endpoint_unreachable/ECONNRESET, before the assertion can compare evidence IDs.The third regression from the same commit — the Frida verifier fixture writing
dist/contracts/fridaRemoteAddress.jswhilescripts/verify-frida.mjsimportsdist/domain/fridaRemoteAddress.js— is #8595 and is fixed in #8596. This PR does not touchtests/boundary/process/providerVerifierCleanup.test.ts, so the two changes stay disjoint.Problem and expected behavior
On a pristine
mainatd3ab0faf5:Expected:
All matched files use the correct format.and 3 passed. Both are now true on this branch.Change and scope
Formatting.
oxfmt .applied to exactly the 16 files the check reports. Line wrapping, blank lines, and quote placement only: no behaviour, assertion, fixture value, or test-name change.docs/testing.mdscripts/verify-adb.mjs,scripts/verify-http3-network-captures.mjssrc/application/electron/ElectronFuseService.test.tssrc/domain/changedBehavior.test.tssrc/domain/managed/managedNativeVerificationSource.test.tssrc/electron/ElectronFuseProvider.test.tstests/boundary/filesystem/releaseNotes.test.tstests/boundary/process/adbVerifierCleanup.test.ts,claudeVerifierSetupTargets.test.ts,clientVerifierSetupTargets.test.ts,commandcodeVerifierSkillBody.test.ts,deepseekVerifierSkillBody.test.ts,geminiVerifierSkillBody.test.tstests/conformance/providers/ghidra/realGhidraWindowsWorkflow.test.tstests/conformance/providers/managed/managedNativeVerification.test.tsFixture keep-alive. One line plus a comment in
tests/fixtures/inspector/fakeV8Inspector.ts:The fixture is not modelling an idle-connection policy, so it has no reason to enforce Node's default there. No assertion, timeout, or stub value is touched, and the test itself is unmodified.
Contract and boundary impact
main.Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.
Evidence and regression coverage
javascriptRuntimeObservationMcp.test.tsexecutes its existing 3 cases again; the formatting half changes no test semantics.get_evidence_bundlefirst callsetInterval(100ms)ticks during that first callnode --cpu-proftop self-time@modelcontextprotocol/clientAjvaddNames2.3s,compileSchema1.0s, codegen/json/version,/json/list, raw CDP WebSocket connect just before the direct observationmainStatic checksand the test shards on this PR will stay red until fix(test): load real Frida verifier address dependency #8596 lands, because the Frida fixture failure is independent of this diff.Validation performed
npx oxfmt --check .—All matched files use the correct format.(exit 0; exit 1 with 16 files on base)node node_modules/vitest/vitest.mjs run tests/boundary/mcp/javascriptRuntimeObservationMcp.test.ts— 3 passed, 3 consecutive runs (4 failed on base)node scripts/run-typescript.mjs --noEmit— exit 0node --check scripts/verify-adb.mjs— exit 0node --check scripts/verify-http3-network-captures.mjs— exit 0git diff --stat upstream/main— 17 files changed, 72 insertions(+), 58 deletions(-)javascriptRuntimeObservation.test.ts,javascriptRuntimeUnresolvedTarget.test.ts) fail identically with the change reverted, so they are unrelated.Compatibility, safety, and release
chore:title, no release-please bump).Author readiness
Human owner: @XiaoBinGan
Before merge
type(scope): outcome.