Add mixed Symbol + Integer keys regression test for #5634#5780
Merged
Conversation
…e-on-exec shape 5634 fixes the Ruby 2.5/2.6/2.7 mixed-keys bug by dropping `**opts` from the wrapper signature, but the test suite has no regression coverage for this specific call shape — only a NOTE block deferring to PR #5774. Add an `it` block under the existing `Process.spawn argument forms (issue #5621 regression)` describe that exercises the exact childprocess close-on-exec form: an options Hash with `IO.pipe` filenos (Integer keys) mixed with Symbol keys (`:pgroup => true`, `fileno => :close`). On Ruby 2.5/2.6/2.7 this triggers `TypeError: no implicit conversion of Hash into String` against the pre-fix wrapper; with `**opts` dropped, the options Hash stays positional and intact across all supported Rubies. Uses the shared `run_spawn` helper and `env_provider:` API already established in the surrounding describe block. Replaces the now-stale NOTE that pointed at PR #5774 — 5634 fixes the same bug, so no deferral is needed. 20 examples pass locally. Co-Authored-By: Claude <[email protected]>
🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: c798066 | Docs | Datadog PR Page | Give us feedback! |
eregon
approved these changes
May 20, 2026
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.
What does this PR do?
Adds a regression test for the Ruby 2.5/2.6/2.7 mixed Symbol + Integer keys options Hash bug (childprocess close-on-exec form). Targets the #5634 branch.
Motivation:
5634 fixes the bug by dropping
**optsfrom the wrapper signature, but the test suite has no regression coverage for this specific call shape — only a NOTE block atspec/datadog/core/utils/spawn_monkey_patch_spec.rb:251-255deferring to #5774. Since 5634 fixes the same bug, the deferral is stale and a test should live alongside the fix.The new test exercises the exact childprocess close-on-exec form: an options Hash with
IO.pipefilenos as Integer keys with:closevalues, mixed with Symbol keys (:pgroup => true). On Ruby 2.5/2.6/2.7 this triggersTypeError: no implicit conversion of Hash into Stringagainst the pre-fix wrapper. With**optsdropped (as 5634 does), the options Hash stays positional and intact.Uses the shared
run_spawnhelper andenv_provider:API already established in the surroundingProcess.spawn argument forms (issue #5621 regression)describe block.Change log entry
None.
Additional Notes:
spec/datadog/core/utils/spawn_monkey_patch_spec.rb:251-255(the one that pointed at Drop unused **opts from Process.spawn wrapper signature #5774) with an inlineitblock. The cross-reference to Drop unused **opts from Process.spawn wrapper signature #5774 is no longer needed because 5634 fixes the same bug.How to test the change?
bundle exec rspec spec/datadog/core/utils/spawn_monkey_patch_spec.rb🤖 Generated with Claude Code