#53932: test: avoid exit race in utility process DNS spec
Description of Change
We found the DNS-result-order spec timing out while testing a downstream Electron fork.
The fixture exits after its stdout write callback runs, but that callback does not guarantee the parent has consumed the data. The utility-process exit handler removes stdout/stderr listeners, so exit arriving before pipe delivery can leave the spec waiting for output. This test checks DNS-option propagation, not stdout behavior.
Use IPC request/reply to obtain dns.getDefaultResultOrder() and assert its exact value. The fixture's message listener keeps it alive until the existing test cleanup terminates it, avoiding the output/exit race without adding a timer or changing runtime behavior.
Backport assessment:
45-x-y,44-x-y, and43-x-ycontain the same affected test and exit cleanup. IPC support is already present, and the change applies cleanly to all three in a three-way backport check.42-x-yhas the same vulnerable fixture and exit cleanup, but its older callback-based test requires a manual adaptation. It is not targeted under the policy of excluding the oldest active release line from routine, non-security fixes.
Validation:
- Focused native Linux DNS-option test: 1/1 passed without retries, using the unchanged runtime.
- Scoped JavaScript lint, formatting, editor diagnostics, and whitespace checks passed.
- Windows and release-branch runtime tests were not run locally.
CC @mlaurencin
Checklist
- I have built and tested this change
- I have filled out the PR description
- I have reviewed and verified the changes
-
npm testpasses (full suite not run locally) - tests are changed or added
Release Notes
Notes: none
Backports
Semver Impact
Semantic Versioning helps users understand the impact of updates:
- Major (X.y.z): Breaking changes that may require code modifications
- Minor (x.Y.z): New features that maintain backward compatibility
- Patch (x.y.Z): Bug fixes that don't change the API
- None: Changes that don't affect using facing parts of Electron