Skip to content

test(performance-timer): reduce flakiness of tests involving actual sleeps#4890

Merged
dbjorge merged 2 commits intodevelopfrom
flaky-perf-test
Sep 24, 2025
Merged

test(performance-timer): reduce flakiness of tests involving actual sleeps#4890
dbjorge merged 2 commits intodevelopfrom
flaky-perf-test

Conversation

@dbjorge
Copy link
Copy Markdown
Contributor

@dbjorge dbjorge commented Sep 24, 2025

Fixes some flaky test cases that were failing as often as not in the test_firefox job, where we were seeing in practice that await sleep(100) was frequently taking much longer than 100ms to actually complete. This updates the tests to avoid using "closeTo" in assertions of how long a sleep lasts, in favor of atLeast + verifying nearness to what performance.now() reports.

I verified this in 10x runs against firefox locally (where it exhibited the same failure before the fix and no failure after the fix) + 3x runs in CI:

@dbjorge dbjorge requested a review from a team as a code owner September 24, 2025 20:37
Copilot AI review requested due to automatic review settings September 24, 2025 20:37
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR addresses flaky test failures in performance timer tests by replacing imprecise time assertions with more robust timing verification that accounts for CI environment variability.

  • Replaces closeTo assertions with atLeast checks for minimum sleep duration
  • Adds timestamp tracking around performance measurements for precise bounds validation
  • Includes debug logging to help diagnose timing issues in CI environments

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@dbjorge dbjorge merged commit 0da4301 into develop Sep 24, 2025
27 checks passed
@dbjorge dbjorge deleted the flaky-perf-test branch September 24, 2025 20:57
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.

3 participants