Skip to content

RUM-19326: Fix flaky baggage header test - #4052

Merged
satween merged 1 commit into
developfrom
tvaleev/rum-19326/fix-flaky-baggage-test
Oct 27, 2026
Merged

satween merged 1 commit into
developfrom
tvaleev/rum-19326/fix-flaky-baggage-test

Conversation

@satween

@satween satween commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Pins the RUM session id in RumContextPropagationTest.M send rum sessionId in baggage header W call is made to SAMPLED_IDS, as the sibling sampling tests do.

Motivation

The test is flaky on develop (~32% failure rate in Flaky Test Management), failing with Expecting actual not to be null.

Since #4027 the test forges a random session id, while the interceptor samples at 50%. About half of the runs take the sampled-out path (setSampledOutHeaders), where the baggage header is not injected.

Additional Notes

The iOS SDK injects baggage for sampled-out requests too; Android does not. That is a behavior change and is out of scope here.

Verified locally: the test class passes on repeated runs, and the test fails when the session id is taken from DROPPED_IDS.

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Make sure you discussed the feature or bugfix with the maintaining team in an Issue
  • Make sure each commit and the PR mention the Issue number (cf the CONTRIBUTING doc)

The test forged a random RUM session id while the interceptor samples
at 50%, so about half of the runs took the sampled-out path, where the
baggage header is not injected. Pin the session id to SAMPLED_IDS, as
the sibling sampling tests do.

Ref: RUM-19326
@datadog-prod-us1-6

datadog-prod-us1-6 Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Pipelines  Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
• Patch Coverage: 100.00%
• Overall Coverage: 71.85% (+0.04%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 9539b74 | Docs | View more details | Give us feedback!

@satween
satween marked this pull request as ready for review October 27, 2026 13:54
@satween
satween requested review from a team as code owners October 27, 2026 13:54
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-27T13:56:03.928459Z 9539b74 Draft marked ready
🔒 Security Review ✅ Completed 2026-10-27T13:56:53.435047Z 9539b74 Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@datadog-prod-us1-6 datadog-prod-us1-6 Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bits Code Review: PASS

More details

Selecting a known sampled session ID removes the random sampling outcome while preserving the baggage-header assertions for account, user, and session IDs.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit 9539b74

@satween
satween merged commit 760c170 into develop Oct 27, 2026
27 checks passed
@satween
satween deleted the tvaleev/rum-19326/fix-flaky-baggage-test branch October 27, 2026 15:24
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