Skip to content

test: clear remaining stale flaky markers and fix banner test isolation - #120851

Closed
JoshuaKGoldberg wants to merge 7 commits into
masterfrom
joshgoldberg/logs-936-clear-remaining-stale-flaky-markers
Closed

test: clear remaining stale flaky markers and fix banner test isolation#120851
JoshuaKGoldberg wants to merge 7 commits into
masterfrom
joshgoldberg/logs-936-clear-remaining-stale-flaky-markers

Conversation

@JoshuaKGoldberg

@JoshuaKGoldberg JoshuaKGoldberg commented Jul 29, 2026

Copy link
Copy Markdown
Member

I audited every remaining it.isKnownFlake() marker in the repo. The only remaining flake I could find was that anomalyDetectionFeedbackBanner.spec.tsxsubmits anomaly detection feedback (yes) fails after its first run because it keys its dismissal in localStorage. This PR clears that between runs.

Otherwise, this just removes all the it.isKnownFlake(). 🤘

Follow-up to a follow-up on LOGS-936

usePrefetchTraceItemDetailsOnHover scheduled a trace-item prefetch on hover start and cleared it only on hover end, so a row that unmounted while its timer was pending still fired the request. In the app that is a wasted fetch after the table is gone; in Jest the timer outlives test cleanup and lands in a later test, which fails on an unmocked /trace-items/{id}/ request.

The hook now tracks the timer it scheduled and clears it on unmount, only releasing the shared ref when the pending timer is its own so an unmounting row cannot cancel a sibling's prefetch. This also drops the trace-item mocks added to logsInfiniteTable.spec.tsx to absorb the leaked requests.

Refs LOGS-936
All seven it.isKnownFlake() markers in this file came from one automated batch on 2026-06-03, generated from CI data collected before the underlying failures were fixed on 2026-05-28 by #116374, #116405, and #114893. The automation never revisits markers, so they have sat here for two months.

Every CI issue Sentry recorded for this file is resolved, and the only event in the last 90 days came from an experimental React-compiler branch rather than master. Local runs are clean: 1436 executions under the 50x stress harness, including four concurrent runs to force CPU contention, plus simulated response latency up to 500ms.

The marker is a no-op in normal CI, expanding to 50 runs only when the Frontend: Rerun Flaky Tests label sets RERUN_KNOWN_FLAKY_TESTS. Removing it changes no default CI behavior; it stops advertising these tests as flaky.

Refs LOGS-936
Removes the 31 remaining it.isKnownFlake() markers and fixes the one test that is genuinely broken.

anomalyDetectionFeedbackBanner's 'submits anomaly detection feedback (yes)' fails 49 of 50 stressed runs. The banner records dismissal in localStorage keyed by incident id via useDismissable, and jsdom keeps that store for the whole file, so only the first run sees a banner to click. The sibling test passes only because it uses a different incident id. Clearing localStorage in beforeEach makes it repeatable: 51/51 stressed, previously 1/50.

The other 30 markers are stale. All date to automation batches merged on 2026-05-26, 06-03, and 06-08; the automation only ever adds markers, and its last three PRs (#117642, #118116, #118627) were closed unmerged, so nothing has marked or unmarked anything on master in seven weeks. Eleven of the nineteen files have had no commit since their marker landed. Every marked test passes in isolation, and 37 of 38 passed 50x stress across two full passes (3928 executions). None of the nineteen files appears among the 49 jest issues currently unresolved in Sentry, while many unmarked files do.

Refs LOGS-936
@linear-code

linear-code Bot commented Jul 29, 2026

Copy link
Copy Markdown

LOGS-936

@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jul 29, 2026
@sentry

sentry Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Sentry Snapshot Testing

Name Added Removed Changed Renamed Unchanged Skipped Status
sentry-frontend
sentry-frontend
0 0 0 0 451 0 ✅ Unchanged

⚙️ sentry-frontend Snapshot Settings

Base automatically changed from joshgoldberg/logs-936-unmark-stale-flaky-logs-table-row-tests to master July 31, 2026 16:04
@JoshuaKGoldberg JoshuaKGoldberg changed the title test: fix banner test isolation and clear remaining stale flaky markers test: clear remaining stale flaky markers and fix banner test isolation Aug 3, 2026
@JoshuaKGoldberg

Copy link
Copy Markdown
Member Author

Superseded by a stack: #121172 fixes the one genuinely broken test, and #121173 removes the stale markers on top of it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant