Skip to content

✅ fix flaky tests related to experimental features#4207

Merged
BenoitZugmeyer merged 1 commit intomainfrom
benoit/push-mpzkwntkqkvv
Feb 18, 2026
Merged

✅ fix flaky tests related to experimental features#4207
BenoitZugmeyer merged 1 commit intomainfrom
benoit/push-mpzkwntkqkvv

Conversation

@BenoitZugmeyer
Copy link
Copy Markdown
Member

Motivation

Some tests cases did not use mockExperimentalFeatures to enable experimental features, and didn't properly clean up after themselves.

This was not an issue before #4149, but now that the experimental feature set is shared between spec files, it becomes important to reset features after each test.

Changes

This commit simplifies how we deal with experimental features in unit tests by:

  • always clearing experimental features in 'forEach.spec'
  • replace mockExperimentalFeatures with addExperimentalFeatures, since it's not useful anymore
  • remove now unnecessary calls to resetExperimentalFeatures

Test instructions

This impacts only unit test. If CI is green, it should be good.

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

Some tests cases did not use `mockExperimentalFeatures` to enable
experimental features, and didn't properly clean up after themselves.

This was not an issue before
#4149, but now that the
experimental feature set is shared between spec files, it becomes
important to reset features after each test.

This commit simplifies how we deal with experimental features in unit
tests by:
* always clearing experimental features in 'forEach.spec'
* replace `mockExperimentalFeatures` with `addExperimentalFeatures`,
  since it's not useful anymore
* remove now unnecessary calls to `resetExperimentalFeatures`
@BenoitZugmeyer BenoitZugmeyer requested review from a team as code owners February 18, 2026 16:19
@cit-pr-commenter-54b7da
Copy link
Copy Markdown

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 171.44 KiB 171.44 KiB 0 B 0.00%
Rum Profiler 4.29 KiB 4.29 KiB 0 B 0.00%
Rum Recorder 24.71 KiB 24.71 KiB 0 B 0.00%
Logs 56.23 KiB 56.23 KiB 0 B 0.00%
Flagging 944 B 944 B 0 B 0.00%
Rum Slim 127.98 KiB 127.98 KiB 0 B 0.00%
Worker 23.63 KiB 23.63 KiB 0 B 0.00%
🚀 CPU Performance

Pending...

🧠 Memory Performance

Pending...

🔗 RealWorld

@datadog-official
Copy link
Copy Markdown

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

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

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

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f2e67890b7

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 15 to 19
isExperimentalFeatureEnabled,
addExperimentalFeatures,
resetExperimentalFeatures,
getExperimentalFeatures,
initFeatureFlags,
ExperimentalFeature,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Re-export resetExperimentalFeatures from browser-core index

Removing resetExperimentalFeatures from the root @datadog/browser-core export list introduces an API break: any downstream package or test utility that imports { resetExperimentalFeatures } from the package entrypoint will now fail to compile (or error on missing export at runtime). Because this change set is aimed at test flakiness rather than a declared breaking-release change, keeping this export in packages/core/src/index.ts avoids unexpectedly breaking consumers.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

core is an internal package.

@BenoitZugmeyer BenoitZugmeyer changed the title ✅ fix flaky tests using experimental features ✅ fix flaky tests related to experimental features Feb 18, 2026
@BenoitZugmeyer BenoitZugmeyer merged commit 67e5142 into main Feb 18, 2026
20 of 21 checks passed
@BenoitZugmeyer BenoitZugmeyer deleted the benoit/push-mpzkwntkqkvv branch February 18, 2026 17:28
@github-actions github-actions bot locked and limited conversation to collaborators Feb 18, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants