Skip to content

[ruby] Enable SymDB system tests#6962

Open
p-datadog wants to merge 13 commits into
mainfrom
ddsign/symdb-ruby-tests
Open

[ruby] Enable SymDB system tests#6962
p-datadog wants to merge 13 commits into
mainfrom
ddsign/symdb-ruby-tests

Conversation

@p-datadog
Copy link
Copy Markdown
Member

@p-datadog p-datadog commented May 18, 2026

Summary

Enables tests/debugger/test_debugger_symdb.py::Test_Debugger_SymDb for the Ruby Rails weblogs (rails72, rails80, uds-rails), targeting gem v2.34.0-dev — the next dd-trace-rb release, where the SymDB component wiring lands (see DataDog/dd-trace-rb#5717, merged to master after v2.33.0).

Refs: DEBUG-5365.

Changes

  • manifests/ruby.yml — flip Test_Debugger_SymDb from missing_feature to v2.34.0-dev for the three Rails weblogs (including Test_Debugger_SymDb::test_event_metadata).
  • tests/debugger/test_debugger_symdb.py — two fixes that matter for Ruby:
    • Call initialize_weblog_remote_config() in _setup so Ruby's lazy RC poller (Remote::Tie.boot, started from the Rack middleware on first request) gets a chance to start before the RC command is sent. No-op for other tracers.
    • Fix check_scope to keep recursing into nested scopes when the name regex matches but scope_type is not in the accepted list. This was short-circuiting on Ruby's FILE root scope (path contains debugger_controller) and missing the nested CLASS(DebuggerController).
  • utils/_remote_config.py — add log lines for RC poll progress and a logged error on timeout so failures point at a state rather than a silent timeout. For Ruby, an additional AssertionError is raised at the timeout point when SYSTEM_TESTS_FAIL_FAST=true is set (default off), to fail loudly during local debugging of the RC poller. The default-off gate keeps setup paths from raising in CI per .cursor/rules/pr-review.mdc §4.

Test plan

  • CI green on the SymDB scenario for the three Ruby Rails weblogs
  • Other tracers: confirm the check_scope recursion fix is a no-op for languages whose DebuggerController-like scope already matches name+type at the same node
  • Confirm the RC diagnostics changes don't regress other scenarios that rely on send_state timing — resolved by gating the Ruby fail-fast behind SYSTEM_TESTS_FAIL_FAST (default off); CI behavior for all scenarios is unchanged from pre-PR

Verification — SymDB scenario ran the enabled tests

Run 26055212800 (commit ce1978e8b). DEBUGGER_SYMDB is scheduled into End-to-end #2logs_debugger_symdb/ is only present in the *_dev_2 artifacts, and report.json shows the tests actually executed (not deselected, not skipped):

Weblog (Ruby dev) test_symdb_upload test_event_metadata Job
rails72 passed xfailed 76603046818
rails80 passed xfailed 76603046960
uds-rails passed xfailed 76603047117

Sanity checks:

  • Each dev_2 job reports collected: 2495, deselected: 2491 in the DEBUGGER_SYMDB report → 4 tests executed (the 2 SymDB above + 2 unrelated Test_DdtraceSchemas runtime checks).
  • Ruby prod side (released gem v2.33.0 < v2.34.0-dev) collected 0 SymDB tests in all three Rails weblogs — the v2.34.0-dev gate keeps them on missing_feature against the released gem, as expected.
  • The job-level red on the three dev_2 jobs is from tests/schemas/test_schemas.py::Test_DdtraceSchemas::test_library, unrelated to SymDB.

Unicorn Enterprises and others added 3 commits May 18, 2026 13:31
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Ruby uses FILE root scopes whose path names can match the
DebuggerController regex via substring. The old logic short-circuited
on name match — if the scope_type wasn't CLASS/MODULE, it returned
False without checking children. Now it always recurses when the
current scope doesn't match both name and type.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 18, 2026

CODEOWNERS have been resolved as:

manifests/ruby.yml                                                      @DataDog/ruby-guild @DataDog/asm-ruby
tests/debugger/test_debugger_symdb.py                                   @DataDog/debugger @DataDog/system-tests-core
utils/_remote_config.py                                                 @DataDog/system-tests-core
utils/interfaces/_core.py                                               @DataDog/system-tests-core

p-ddsign added 5 commits May 18, 2026 15:20
The RC diagnostics commit uses the boolean return value of wait_for to
log timeout state and assert the wait succeeded. Update the wait_for
return type from None to bool so mypy accepts the new diagnostics.

Other callers ignore the return value, which remains valid.
Document the Ruby-specific reasons for the two test edits:
- initialize_weblog_remote_config() is needed because Ruby's RC poller
  starts lazily from the Rack middleware
- check_scope must always recurse because Ruby's FILE root scope name
  matches the regex but its scope_type does not
@p-datadog p-datadog force-pushed the ddsign/symdb-ruby-tests branch from e1bf829 to ce1978e Compare May 18, 2026 19:20
@datadog-datadog-prod-us1-2
Copy link
Copy Markdown

datadog-datadog-prod-us1-2 Bot commented May 18, 2026

Pipelines  Tests

Fix all issues with BitsAI

⚠️ Warnings

🚦 1 Pipeline job failed

DataDog/system-tests | Amazon_Linux_2_arm64.HOBC: [test-app-dotnet]   View in Datadog   GitLab

🔄 Retry job. This looks flaky and may succeed on retry. AssertionError: There are previous errors in the virtual machine provisioning steps. Check log file: Amazon_Linux_2_arm64.log

ℹ️ Info

No other issues found (see more)

🧪 All tests passed
❄️ No new flaky tests detected

Useful? React with 👍 / 👎

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

The assert added in b033a47 was reached by every tracer's debugger
scenarios via the shared send_state call site, and turned a previously
tolerated silent-timeout into a hard collection-time error in 75 jobs
across dotnet / nodejs / python / golang / java.

Root cause is a real cross-tracer state-reporting gap (Go omits
apply_state from config_states; Python drops the entry on a version
update) but fixing those is out of scope for this PR. Gate the assert
on context.library == "ruby" so the diagnostic stays loud for the
SymDB tests this PR enables, and other tracers go back to their
pre-PR silent behavior. The logger.error diagnostic lines remain
always-on.

Refs: DEBUG-5365
@p-datadog p-datadog marked this pull request as ready for review May 20, 2026 00:58
@p-datadog p-datadog requested review from a team as code owners May 20, 2026 00:58
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8a76b1f616

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread utils/_remote_config.py Outdated
Address review comment: setup methods must not fail (.cursor/rules/pr-review.mdc §4).
The `assert rv` added for Ruby was reachable from `Test_Debugger_SymDb._setup` via
`send_rc_symdb` -> `send_symdb_command` -> `send_state`, violating the rule in CI.

- The Ruby-specific raise is now gated on SYSTEM_TESTS_FAIL_FAST=true; default off
  preserves CI's setup-can't-raise invariant.
- The two logger.error lines remain, so RC timeouts still surface in CI logs with
  the last-known targets_version and config_states. The test then fails downstream
  in _assert_symbols_uploaded as it did pre-PR.
- Local debugging of Ruby RC plumbing: export SYSTEM_TESTS_FAIL_FAST=true to fail
  at the timeout point.

Verified: ast.parse OK; no other asserts added in setup-reachable paths in the
PR diff.
@p-datadog
Copy link
Copy Markdown
Member Author

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3e7a33c70e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread utils/_remote_config.py Outdated
p-ddsign and others added 3 commits May 20, 2026 14:39
The per-test missing_feature override for `test_event_metadata` is removed; the
test now inherits the parent `Test_Debugger_SymDb` declaration (v2.34.0-dev for
the three Rails weblogs).

Also drops the stale `# TODO: drop the -dev suffix when v2.34.0 is released`
comment.

Verified: YAML parses; manifest entry now matches the parent's structure.
The multi-line `if` block introduced in 3e7a33c tripped `ruff format --check`
in the `lint / lint` GitHub Actions job. Ruff prefers a single-line conditional
here. Behavior is unchanged.

Verified: `ruff check`, `ruff format --check`, and `mypy --config pyproject.toml`
all pass on utils/_remote_config.py.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants