Skip to content

Conversation

@watson
Copy link
Contributor

@watson watson commented Jan 30, 2026

Motivation

CI intermittently fails tests/debugger/test_debugger_inproduct_enablement.py::Test_Debugger_InProduct_Enablement_Code_Origin::test_inproduct_enablement_code_origin on nodejs/fastify with AssertionError: Expected code origin enabled by default (example). The failure is flaky (rerun passes), which points to a timing window in how we detect code origin spans rather than a deterministic tracer behavior change.

Changes

  • Stabilize code origin span detection by scoping the search to the triggering request (RID-based filtering) in tests/debugger/utils.py.
  • Update tests/debugger/test_debugger_inproduct_enablement.py to pass the request/response into the waiter so the check is tied to the exact / request under test.

This should avoid a race where the relevant /api/v0.2/traces payload is ingested before the previous threshold-based wait begins scanning, producing a false negative under CI timing.

Workflow

  1. ⚠️ Create your PR as draft ⚠️
  2. Work on you PR until the CI passes
  3. Mark it as ready for review
    • Test logic is modified? -> Get a review from RFC owner.
    • Framework is modified, or non obvious usage of it -> get a review from R&P team

🚀 Once your PR is reviewed and the CI green, you can merge it!

🛟 #apm-shared-testing 🛟

Reviewer checklist

  • Anything but tests/ or manifests/ is modified ? I have the approval from R&P team
  • A docker base image is modified?
    • the relevant build-XXX-image label is present
  • A scenario is added, removed or renamed?

Scope code origin span detection to the triggering request RID.

This should avoid a timing window where the first trace payload can be
ingested before the wait helper captures its threshold, causing CI flakes.
Copy link
Contributor Author

watson commented Jan 30, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 30, 2026

CODEOWNERS have been resolved as:

.github/workflows/run-end-to-end.yml                                    @DataDog/system-tests-core
tests/debugger/test_debugger_inproduct_enablement.py                    @DataDog/debugger @DataDog/system-tests-core
tests/debugger/utils.py                                                 @DataDog/debugger @DataDog/system-tests-core

@datadog-datadog-prod-us1
Copy link

datadog-datadog-prod-us1 bot commented Jan 30, 2026

⚠️ Tests

Fix all issues with Cursor

⚠️ Warnings

❄️ 2 New flaky tests detected

tests.debugger.test_debugger_inproduct_enablement.Test_Debugger_InProduct_Enablement_Code_Origin.test_inproduct_enablement_code_origin[express4-typescript] from system_tests_suite (Datadog) (Fix with Cursor)
AssertionError: Expected code origin enabled by default
assert False
 +  where False = <tests.debugger.test_debugger_inproduct_enablement.Test_Debugger_InProduct_Enablement_Code_Origin object at 0x7f7f3ce38530>.co_initial_state

self = <tests.debugger.test_debugger_inproduct_enablement.Test_Debugger_InProduct_Enablement_Code_Origin object at 0x7f7f3ce38530>

    def test_inproduct_enablement_code_origin(self):
        self.assert_rc_state_not_error()
        self.assert_all_weblog_responses_ok()
    
...
tests.debugger.test_debugger_inproduct_enablement.Test_Debugger_InProduct_Enablement_Code_Origin.test_inproduct_enablement_code_origin[uds-express4] from system_tests_suite (Datadog) (Fix with Cursor)
AssertionError: Expected code origin enabled by default
assert False
 +  where False = <tests.debugger.test_debugger_inproduct_enablement.Test_Debugger_InProduct_Enablement_Code_Origin object at 0x7f7c7aba6ba0>.co_initial_state

self = <tests.debugger.test_debugger_inproduct_enablement.Test_Debugger_InProduct_Enablement_Code_Origin object at 0x7f7c7aba6ba0>

    def test_inproduct_enablement_code_origin(self):
        self.assert_rc_state_not_error()
        self.assert_all_weblog_responses_ok()
    
...

🧪 1 Test failed

❄️ Known flaky: tests.debugger.test_debugger_inproduct_enablement.Test_Debugger_InProduct_Enablement_Code_Origin.test_inproduct_enablement_code_origin[express4] from system_tests_suite (Datadog) (Fix with Cursor)
AssertionError: Expected code origin enabled by default
assert False
 +  where False = <tests.debugger.test_debugger_inproduct_enablement.Test_Debugger_InProduct_Enablement_Code_Origin object at 0x7f90ac71df40>.co_initial_state

self = <tests.debugger.test_debugger_inproduct_enablement.Test_Debugger_InProduct_Enablement_Code_Origin object at 0x7f90ac71df40>

    def test_inproduct_enablement_code_origin(self):
        self.assert_rc_state_not_error()
        self.assert_all_weblog_responses_ok()
    
...
This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 11e8159 | Docs | Datadog PR Page | Was this helpful? Give us feedback!

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.

2 participants