test(cmux-next): reserve the cloexec probe descriptor

Merged
TE
12d ago
+14-1

Summary

The daemon socket CLOEXEC test probed a low descriptor number directly. A shell or unrelated inherited descriptor could occupy that number and make the redirection succeed even when the transport socket was correctly closed on exec.

Duplicate the descriptor into a reserved high range while preserving its descriptor flags before spawning the probe shell. The test still asserts the transport's FD_CLOEXEC bit and retains the no-CLOEXEC control case.

Validation

  • python3 scripts/verify-local.py --only swift-syntax --swift-changed origin/feat-cmux-next
  • Fleet daemon test job required for native validation

Changelog

Fixed flaky daemon socket close-on-exec coverage.

šŸ¤– Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.


Summary by cubic

Fixes the daemon socket CLOEXEC test so it no longer falsely passes when an unrelated inherited descriptor occupies the probed number. The test now duplicates the descriptor into a reserved range (≄ 128) while preserving its flags before spawning the probe shell, and still asserts the transport's FD_CLOEXEC bit with the no-CLOEXEC control case intact.