Skip to content

[nodejs] fix flaky debugger test#6215

Draft
watson wants to merge 3 commits intomainfrom
watson/fix-flake2
Draft

[nodejs] fix flaky debugger test#6215
watson wants to merge 3 commits intomainfrom
watson/fix-flake2

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 New flaky tests detected

tests.debugger.test_debugger_capture_expressions.Test_Debugger_Method_Capture_Expressions.test_log_method_capture_expressions[spring-boot-jetty] from system_tests_suite (Datadog) (Fix with Cursor)
AssertionError: assert 'Snapshot was not received' is None
 +  where 'Snapshot was not received' = <built-in method join of str object at 0x7fabf442aa60>(['Snapshot was not received'])
 +    where <built-in method join of str object at 0x7fabf442aa60> = '\n'.join
 +    and   ['Snapshot was not received'] = <tests.debugger.test_debugger_capture_expressions.Test_Debugger_Method_Capture_Expressions object at 0x7fabec2b5520>.setup_failures

self = <tests.debugger.test_debugger_capture_expressions.Test_Debugger_Method_Capture_Expressions object at 0x7fabec2b5520>

    def test_log_method_capture_expressions(self):
>       self._assert()

...
tests.debugger.test_debugger_pii.Test_Debugger_PII_Redaction.test_pii_redaction_method_full[uds-spring-boot] from system_tests_suite (Datadog) (Fix with Cursor)
KeyError: 'log170aa-acda-4453-9111-1478a6method'

self = <tests.debugger.test_debugger_pii.Test_Debugger_PII_Redaction object at 0x7f35ebe86390>

    @missing_feature(
        context.library == "ruby", reason="Local variable capture not implemented for method probes", force_skip=True
    )
    @missing_feature(context.library == "nodejs", reason="Not yet implemented", force_skip=True)
    def test_pii_redaction_method_full(self):
>       self._assert()
...

ℹ️ Info

🧪 All tests passed

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 0db7452 | 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
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