Skip to content

Conversation

@watson
Copy link
Contributor

@watson watson commented Feb 5, 2026

Motivation

The Test_Debugger_InProduct_Enablement_Code_Origin.test_inproduct_enablement_code_origin test was flaky in CI. Investigation seems to have revealed a race condition in wait_for_code_origin_span where the threshold (maximum trace file number) was calculated after sending the HTTP request, causing the test to miss traces that arrived quickly.

Changes

Attempt to fixed the race condition by ensuring the threshold is calculated before sending the request:

  • tests/debugger/test_debugger_inproduct_enablement.py: Modified _check_code_origin() to get threshold before sending request
  • tests/debugger/utils.py: Updated wait_for_code_origin_span() to accept optional threshold parameter for backward compatibility

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?

Copy link
Contributor Author

watson commented Feb 5, 2026

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

@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 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-official
Copy link

datadog-official bot commented Feb 5, 2026

⚠️ Tests

Fix all issues with Cursor

⚠️ Warnings

🧪 2 Tests failed

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 0x7f9472b56ed0>.co_initial_state

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

    def test_inproduct_enablement_code_origin(self):
        self.assert_rc_state_not_error()
        self.assert_all_weblog_responses_ok()
    
...
❄️ Known flaky: tests.debugger.test_debugger_inproduct_enablement.Test_Debugger_InProduct_Enablement_Code_Origin.test_inproduct_enablement_code_origin[fastify] 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 0x7fe222963d40>.co_initial_state

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

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

ℹ️ Info

❄️ No new flaky tests detected

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 47d07c8 | Docs | Datadog PR Page | Was this helpful? Give us feedback!

@watson watson force-pushed the watson/fix-flake2 branch from d8eaa32 to 36bcfc1 Compare February 5, 2026 13:43
@watson watson force-pushed the watson/fix-flake2 branch from 36bcfc1 to 883d1a2 Compare February 6, 2026 13:01
@watson watson force-pushed the watson/fix-flake2 branch from 0403b3c to 0db7452 Compare February 6, 2026 21:08
@watson watson force-pushed the watson/fix-flake2 branch from af47ebf to 1340fd9 Compare February 7, 2026 07:57
@watson watson force-pushed the watson/fix-flake2 branch from e0f5494 to 6fcb09d Compare February 7, 2026 09:43
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.

1 participant