Skip to content

fix: Addresses styles-check flakiness#4256

Open
pan-kot wants to merge 8 commits intomainfrom
experiment-flaky-test
Open

fix: Addresses styles-check flakiness#4256
pan-kot wants to merge 8 commits intomainfrom
experiment-flaky-test

Conversation

@pan-kot
Copy link
Member

@pan-kot pan-kot commented Feb 16, 2026

Description

The styles check util validates the presence of the component styles on the page and logs an error like Missing AWS-UI CSS for theme... to the console when the styles are not present.

This util causes integ tests flakiness with over 10 recorded occurrences.

The PR addresses the problem by making changes to the util so that it validates that the stylesheets (present upon document readiness) are loaded.

How has this been tested?

  • New unit tests to cover the util changes
  • Dry-run to live
  • 400+ test runs with React v16 and v18 of the most affected tests: there was not a single occurrence of the issue in the logs (I checked for "AWS-UI CSS" in GitHub actions logs instead of looking at the test failures as we have retries. Before the fix these messages were consistently present).
Review checklist

The following items are to be evaluated by the author(s) and the reviewer(s).

Correctness

  • Changes include appropriate documentation updates.
  • Changes are backward-compatible if not indicated, see CONTRIBUTING.md.
  • Changes do not include unsupported browser features, see CONTRIBUTING.md.
  • Changes were manually tested for accessibility, see accessibility guidelines.

Security

Testing

  • Changes are covered with new/existing unit tests?
  • Changes are covered with new/existing integration tests?

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@codecov
Copy link

codecov bot commented Feb 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.31%. Comparing base (8c20e1c) to head (bfd5a47).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4256      +/-   ##
==========================================
+ Coverage   97.19%   97.31%   +0.11%     
==========================================
  Files         886      888       +2     
  Lines       26038    26029       -9     
  Branches     9438     9409      -29     
==========================================
+ Hits        25308    25329      +21     
+ Misses        724      694      -30     
  Partials        6        6              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pan-kot pan-kot force-pushed the experiment-flaky-test branch from 2b7fefb to 18ab8f3 Compare February 16, 2026 15:23
@pan-kot pan-kot changed the title chore: Experiment with flaky test fix: Addresses styles-check flakiness Feb 17, 2026
@pan-kot pan-kot force-pushed the experiment-flaky-test branch from df22d00 to d3df365 Compare February 17, 2026 12:36
@@ -1,47 +0,0 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
Copy link
Member Author

Choose a reason for hiding this comment

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

I renamed this file to "styles-check.test.tsx" as now there is a single util that we test.

@@ -1,185 +0,0 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
Copy link
Member Author

Choose a reason for hiding this comment

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

I removed this file where the tests were done by calling checkMissingStyles and documentReadyAndIdle utils directly. Instead, all tests are now done against the useMissingStylesCheck.

I ensured that every test from this file is represented in the new tests.

@pan-kot pan-kot force-pushed the experiment-flaky-test branch from d3df365 to bfd5a47 Compare February 17, 2026 12:39
@pan-kot pan-kot marked this pull request as ready for review February 17, 2026 12:40
@pan-kot pan-kot requested a review from a team as a code owner February 17, 2026 12:40
@pan-kot pan-kot requested review from jperals and removed request for a team February 17, 2026 12:40
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