test: make env-dependent dns/abort-signal conformance robust on CI#94
Merged
Conversation
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.
Summary
Two
builtin_conformancecases pass on the dev machines but diverged on the CI runner. They were never reached before because the clippy/toolchain step (#93) short-circuited CI; once that was fixed, the test step surfaced these pre-existing host-environment-dependent failures. Both divergences are in the host reference side (the runner's environment), not in the guest V8 runtime — confirmed by reproducing the CI conditions locally (Node 22 host + isolated child).1.
dns— host Node version differenceThe test points both host Node and the guest V8 shim at the same in-process
FixtureDnsServer, so every resolved value is deterministic. The only divergence:dns.resolveSrv/resolveCaa/resolve(..., "MX")records carry atypediscriminator ("type":"SRV", etc.) on Node >= 24 but not on Node <= 22. CI runs on Node 22; dev machines run Node 24. The guest shim always emits the modern shape withtype, so a rawguest == hostcomparison flapped purely on the runner's Node version.Fix: strip the version-dependent
typefield from both sides before the guest-vs-host comparison (still covering every version-stable field — addresses, ttls, priorities, exchanges, ports, SOA fields, ...), and additionally assert the guest's owntypediscriminators directly so guest record-shape correctness is still tested, independent of host Node version. Verified the case now passes with both Node 22 and Node 24 as the host.2.
child-process-abort-signal— fragile cross-runtime/tmpfile pathThe test wrote a child script to a hardcoded host path
/tmp/secure-exec-abort-child.cjsand spawnednode <file>withcwd: "/tmp". That file is written into the guest VFS by the parent, but the spawned guest child resolved the module against the runner's filesystem and failed withCannot find module— exiting with code 1 before ever reachingprocess.abort(). Whether it happened to work depended on the runner's/tmplayout. (The guest'sprocess.abort()-> SIGABRT path itself is correct; this was never exercised because the child couldn't start.)Fix: spawn an inline
node -e "process.abort();"child (mirroring the siblingchild-process-kill-numeric-signalcase), exercising the exact same guest behavior —process.abort()mapping to a SIGABRT-shaped exit — with no cross-runtime filesystem dependency. The full host-vs-guest equality and thesignal == "SIGABRT"/signalCodeAfterExit == "SIGABRT"assertions are retained.Verification
cargo test -p secure-exec-sidecar --test builtin_conformance— all 28 cases pass (Node 24).dnsandchild-process-abort-signalnow pass.cargo clippy --workspace --all-targets -- -D warnings— clean (toolchain pinned 1.96.0).cargo fmt --all --check— clean.