Skip to content

Add mixed Symbol + Integer keys regression test for #5634#5780

Merged
eregon merged 2 commits into
masterfrom
claude/spawn-5634-add-mixed-keys-test
May 20, 2026
Merged

Add mixed Symbol + Integer keys regression test for #5634#5780
eregon merged 2 commits into
masterfrom
claude/spawn-5634-add-mixed-keys-test

Conversation

@p-datadog

Copy link
Copy Markdown
Member

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 **opts from the wrapper signature, but the test suite has no regression coverage for this specific call shape — only a NOTE block at spec/datadog/core/utils/spawn_monkey_patch_spec.rb:251-255 deferring 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.pipe filenos as Integer keys with :close values, mixed with Symbol keys (:pgroup => true). 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 (as 5634 does), the options Hash stays positional and intact.

Uses the shared run_spawn helper and env_provider: API already established in the surrounding Process.spawn argument forms (issue #5621 regression) describe block.

Change log entry

None.

Additional Notes:

How to test the change?

bundle exec rspec spec/datadog/core/utils/spawn_monkey_patch_spec.rb

🤖 Generated with Claude Code

…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]>
@p-datadog p-datadog added the AI Generated Largely based on code generated by an AI or LLM. This label is the same across all dd-trace-* repos label May 19, 2026
@p-datadog
p-datadog requested a review from a team as a code owner May 19, 2026 18:03
@p-datadog p-datadog added the AI Generated Largely based on code generated by an AI or LLM. This label is the same across all dd-trace-* repos label May 19, 2026
@dd-octo-sts dd-octo-sts Bot added the dev/testing Involves testing processes (e.g. RSpec) label May 19, 2026
Base automatically changed from marco/issue-5621-process-spawn to master May 19, 2026 18:37
@datadog-prod-us1-5

Copy link
Copy Markdown

Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 16.67%
Overall Coverage: 97.09% (-0.00%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: c798066 | Docs | Datadog PR Page | Give us feedback!

@eregon
eregon merged commit 68ef1da into master May 20, 2026
303 checks passed
@eregon
eregon deleted the claude/spawn-5634-add-mixed-keys-test branch May 20, 2026 09:05
@dd-octo-sts dd-octo-sts Bot added this to the 2.34.0 milestone May 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI Generated Largely based on code generated by an AI or LLM. This label is the same across all dd-trace-* repos dev/testing Involves testing processes (e.g. RSpec)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants