Skip to content

🐛 Fix flaky stylesheet rules test#4803

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
mainfrom
seth.fowler/address-flaky-stylesheet-rules-test
Jun 18, 2026
Merged

🐛 Fix flaky stylesheet rules test#4803
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
mainfrom
seth.fowler/address-flaky-stylesheet-rules-test

Conversation

@sethfowler-datadog

Copy link
Copy Markdown
Contributor

Motivation

The captures stylesheet rules test in record.spec.ts is flaky. Let's try to fix that.

Changes

There are two factors that seem to contribute to this test's flakiness:

  1. It uses the real setTimeout(), rather than a mock clock, so it's sensitive to sometimes-unpredictable timing in CI.
  2. It expects an exact sequence of records, instead of just checking that all of the records it expects are present. If another tracker happens to emit a record that's not part of the assertion, the test fails.

This PR fixes both issues:

  1. The test has been converted to use mockClock().
  2. The test now filters the records it receives, and only asserts against the kinds of records it's actually interested in.

Locally, the new version seems to be solid; I'm hoping this will fix the flakiness in CI.

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

@sethfowler-datadog sethfowler-datadog requested review from a team as code owners June 17, 2026 16:02
@sethfowler-datadog

Copy link
Copy Markdown
Contributor Author

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Jun 18, 2026

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-06-18 13:49:42 UTC ℹ️ Start processing command /merge


2026-06-18 13:49:47 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in main is approximately 26m (p90).


2026-06-18 14:06:03 UTC ℹ️ MergeQueue: This merge request was merged

@gh-worker-dd-mergequeue-cf854d gh-worker-dd-mergequeue-cf854d Bot merged commit bcc2105 into main Jun 18, 2026
31 checks passed
@gh-worker-dd-mergequeue-cf854d gh-worker-dd-mergequeue-cf854d Bot deleted the seth.fowler/address-flaky-stylesheet-rules-test branch June 18, 2026 14:06
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 18, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants