Skip to content

✅ Add debugger E2E coverage for delivery lifecycle#4738

Draft
watson wants to merge 1 commit into
watson/refactor-e2efrom
watson/more-debugger-e2e
Draft

✅ Add debugger E2E coverage for delivery lifecycle#4738
watson wants to merge 1 commit into
watson/refactor-e2efrom
watson/more-debugger-e2e

Conversation

@watson
Copy link
Copy Markdown
Collaborator

@watson watson commented Jun 6, 2026

Motivation

Debugger unit tests cover expression evaluation, budgets, and serialization details, but we were missing focused browser-level coverage for Delivery API polling and lifecycle behavior. These paths depend on real browser timers, fetch, page reloads, and the E2E Datadog proxy.

Changes

  • Assert exception snapshot stacktraces include cross-browser-safe frame fields.
  • Add E2E coverage for delayed debugger probe delivery through real Delivery API polling.
  • Add E2E coverage for probe deletion so removed probes stop firing after polling.
  • Add E2E coverage that captures browser-native objects without asserting serializer internals.
  • Extend the debugger Datadog proxy control API to model full probe responses, including deletions.

Test instructions

  • yarn lint
  • yarn typecheck
  • yarn test:e2e -g "debugger"

Checklist

  • Tested locally
  • Tested on staging
  • Added unit tests for this change.
  • Added e2e/integration tests for this change.
  • Updated documentation and/or relevant AGENTS.md file

Copy link
Copy Markdown
Collaborator Author

watson commented Jun 6, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

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

@datadog-datadog-prod-us1
Copy link
Copy Markdown

datadog-datadog-prod-us1 Bot commented Jun 6, 2026

Pipelines  Tests

Fix all issues with BitsAI

⚠️ Warnings

🚦 5 Pipeline jobs failed

DataDog/browser-sdk | e2e: [chromium-pinned]   View in Datadog   GitLab

🧪 3 Tests failed

debugger › fetch probes from the Delivery API after initial load › async from debugger.scenario.ts   View in Datadog (Fix with Cursor)
page.waitForFunction: EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self' 'unsafe-inline' http://172.28.206.35:9400".

[chromium-pinned] › debugger.scenario.ts:234:13 › debugger › fetch probes from the Delivery API after initial load › async 

    Error: page.waitForFunction: EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self' 'unsafe-inline' http://172.28.206.35:9400".

        at eval (<anonymous>)
        at predicate (eval at evaluate (:226:30), <anonymous>:11:37)
        at next (eval at evaluate (:226:30), <anonymous>:32:31)
        at predicate (eval at evaluate (:226:30), <anonymous>:11:37)
...
debugger › fetch probes from the Delivery API after initial load › bundle from debugger.scenario.ts   View in Datadog (Fix with Cursor)
page.waitForFunction: EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self' 'unsafe-inline' http://172.28.206.35:9361".

[chromium-pinned] › debugger.scenario.ts:234:13 › debugger › fetch probes from the Delivery API after initial load › bundle 

    Error: page.waitForFunction: EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self' 'unsafe-inline' http://172.28.206.35:9361".

        at eval (<anonymous>)
        at predicate (eval at evaluate (:226:30), <anonymous>:11:37)
        at next (eval at evaluate (:226:30), <anonymous>:32:31)
        at predicate (eval at evaluate (:226:30), <anonymous>:11:37)
...
View all 3 test failures

DataDog/browser-sdk | e2e: [firefox-pinned]   View in Datadog   GitLab

🧪 4 Tests failed

debugger › fetch probes from the Delivery API after initial load › async from debugger.scenario.ts   View in Datadog (Fix with Cursor)
page.waitForFunction: call to eval() blocked by CSP

[firefox-pinned] › debugger.scenario.ts:234:13 › debugger › fetch probes from the Delivery API after initial load › async 

    Error: page.waitForFunction: call to eval() blocked by CSP
    predicate@debugger eval code line 226 > eval:11:37
    next@debugger eval code line 226 > eval:32:31
    FrameRequestCallback*next@debugger eval code line 226 > eval:37:69
    @debugger eval code line 226 > eval:42:11
    evaluate@debugger eval code:228:17
...
debugger › fetch probes from the Delivery API after initial load › bundle from debugger.scenario.ts   View in Datadog (Fix with Cursor)
page.waitForFunction: call to eval() blocked by CSP

[firefox-pinned] › debugger.scenario.ts:234:13 › debugger › fetch probes from the Delivery API after initial load › bundle 

    Error: page.waitForFunction: call to eval() blocked by CSP
    predicate@debugger eval code line 226 > eval:11:37
    next@debugger eval code line 226 > eval:32:31
    FrameRequestCallback*next@debugger eval code line 226 > eval:37:69
    @debugger eval code line 226 > eval:42:11
    evaluate@debugger eval code:228:17
...
View all 4 test failures

DataDog/browser-sdk | e2e: [firefox]   View in Datadog   GitLab

🧪 3 Tests failed

debugger › capture exception in snapshot on throw › async from debugger.scenario.ts   View in Datadog (Fix with Cursor)
expect(received).toBeGreaterThan(expected)

[firefox] › debugger.scenario.ts:196:13 › debugger › capture exception in snapshot on throw › async 

    Error: expect(received).toBeGreaterThan(expected)

    Expected: > 0
    Received:   0

      224 |       const stacktrace = snapshot.captures.return.throwable.stacktrace
...
debugger › capture exception in snapshot on throw › bundle from debugger.scenario.ts   View in Datadog (Fix with Cursor)
expect(received).toBeGreaterThan(expected)

[firefox] › debugger.scenario.ts:196:13 › debugger › capture exception in snapshot on throw › bundle 

    Error: expect(received).toBeGreaterThan(expected)

    Expected: > 0
    Received:   0

      224 |       const stacktrace = snapshot.captures.return.throwable.stacktrace
...
View all 3 test failures

View all 5 failed jobs.

ℹ️ Info

No other issues found (see more)

❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 76.72% (+0.00%)

Useful? React with 👍 / 👎

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

@cit-pr-commenter-54b7da
Copy link
Copy Markdown

cit-pr-commenter-54b7da Bot commented Jun 6, 2026

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 171.86 KiB 171.86 KiB 0 B 0.00%
Rum Profiler 7.88 KiB 7.88 KiB 0 B 0.00%
Rum Recorder 21.21 KiB 21.21 KiB 0 B 0.00%
Logs 54.31 KiB 54.31 KiB 0 B 0.00%
Rum Slim 129.69 KiB 129.69 KiB 0 B 0.00%
Worker 22.96 KiB 22.96 KiB 0 B 0.00%

@watson watson force-pushed the watson/refactor-e2e branch from 231f77d to 4964263 Compare June 6, 2026 17:10
@watson watson force-pushed the watson/more-debugger-e2e branch from 64c78c9 to 0a8a745 Compare June 6, 2026 17:10
Cover browser-sensitive debugger behavior that unit tests cannot fully
exercise: stacktrace frame shape, delayed Delivery API polling, probe
deletion, and native browser object capture.

Extend the debugger Datadog proxy control API so E2E tests can model
delivery responses with updates and deletions.
@watson watson force-pushed the watson/more-debugger-e2e branch from 0a8a745 to 849d177 Compare June 7, 2026 04:48
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