Skip to content

test(system-page): wrap fake-timer plane flips in act - #27886

Merged
bolichen97 merged 1 commit into
mainfrom
test/act-warnings-system-page
Nov 2, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
test/act-warnings-system-page

Conversation

@javenciu

@javenciu javenciu commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: website/src/test/SystemPage.test.tsx stops emitting React act() warnings, so its row leaves website/integration/act-warning-baseline.json and the guard in website/integration/setup.ts checks it like any file outside the list.

Before this change, a run of the file emitted 12 act() warnings (late state updates in PerformanceTab): a state update landed after the test's last barrier. Because the file is on the baseline, the guard kept those warnings out of the log.

Why it matters

website/docs/testing.md (Rules every test keeps) treats an act() warning as a finding: the update lands after the assertions, so whether the test sees it depends on timing. The baseline is shrink-only, and each file that leaves it is held to the rule from then on.

Not a goal

  • Other files on the baseline (each is its own change).
  • Any change to the components under test.
  • Filtering or silencing the warning; the test waits for the update instead.

What changed (motivation → approach → change)

The tests now wait for the state the late update produces before they finish, so the update lands inside the test's barrier.

  • website/src/test/SystemPage.test.tsx: import { screen, fireEvent, waitFor, act } from '@testing-library/react'
  • website/src/test/SystemPage.test.tsx: await act(async () => { await vi.advanceTimersByTimeAsync(2200) })
  • website/src/test/SystemPage.test.tsx: await act(async () => { await vi.advanceTimersByTimeAsync(2200) })
  • website/src/test/SystemPage.test.tsx: await act(async () => { fireEvent.mouseDown(tab!) })
  • website/src/test/SystemPage.test.tsx: await act(async () => { await vi.advanceTimersByTimeAsync(50) })
  • website/integration/act-warning-baseline.json: removed src/test/SystemPage.test.tsx.

Backwards compatibility

Compatible: test-only change.
Removes nothing: a baseline row is a tolerance the guard stops needing, not a capability.

Tests

  • Before (the row removed, the file unchanged): KIROCREW_ACT_STRICT=1 npx vitest run src/test/SystemPage.test.tsx from website/: 1 of 6 tests fail on act() warnings.
  • After: the same command passes 5 runs out of 5 with 0 act() warnings; 6 tests, the same count as before.
  • integration/setup.refactor.determinism.test.ts passes (the baseline stays sorted, unique and existing); npx eslint is clean on the file.

Manual verification

N/A: test-only change; the strict runs above are the check.

Screenshots / video

Why no screenshot: nothing renders; this change touches one test file and a test baseline only.

No issue exists; burn-down of the act() warning baseline that #17673 introduced.

Make website/src/test/SystemPage.test.tsx stop emitting React act() warnings, and drop its row from
website/integration/act-warning-baseline.json so the guard in website/integration/setup.ts checks it.
@javenciu
javenciu requested review from a team and KiroCrewCaptain as code owners November 2, 2026 06:37
@javenciu
javenciu requested a review from bolichen97 November 2, 2026 06:37
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 2, 2026
@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ⏭️ skipped

Revision e59ed85bb023f0bd9444d503d50284e51d0fc31d ships no reviewable capability (docs, tests or generated files only), so there is nothing to inventory. Does not block merge.

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of e59ed85bb023f0bd9444d503d50284e51d0fc31d — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks: this is a test-only change. Late updates now land inside act(), and the baseline only shrinks.

Notes

  • The description says the tests "wait for the state the late update produces," but the diff wraps the timer advances in act() and adds no new wait. Reword it so it matches the code.

[DESIGN-REVIEWED] e59ed85

Description read

[DESCRIPTION-READ] a45d81e4d2b0755d2676a46af58aeadc4dbc1a3cfbb6fc004a45606e40dc87a4

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

UX-level review of e59ed85bb023f0bd9444d503d50284e51d0fc31d — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

UX-Verdict: PASS

Nothing to check. The PR changes only a test file and the act-warning baseline, so it adds or changes nothing a user sees.

[UX-REVIEWED] e59ed85

Description read

[DESCRIPTION-READ] efbdaa5aab0261a1e7b5207d0049f4b0ad41b625ab6330d3b3706ecbbc8035f1

That sha256 names everything this verdict read: the PR description, plus the 3 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed e59ed85bb023f0bd9444d503d50284e51d0fc31d — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] e59ed85

Verdict parsed from the review's SHA-scoped output markers for commit e59ed85bb023f0bd9444d503d50284e51d0fc31d.

False positive or not applicable? A repository writer can comment:
/ai-review override fable e59ed85bb023f0bd9444d503d50284e51d0fc31d false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of e59ed85bb023f0bd9444d503d50284e51d0fc31d and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] e59ed85

False positive or not applicable? A repository writer can comment:
/ai-review override gpt e59ed85bb023f0bd9444d503d50284e51d0fc31d false-positive: <reason, 20 to 500 characters>

@bolichen97 bolichen97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approving at e59ed85.

Read the full diff (2 files, +5 -6):

  • website/src/test/SystemPage.test.tsx: in the Performance history test, the two 2200 ms fake-timer advances, the tab mouseDown and the 50 ms advance in goTo now each run inside await act(async () => ...), and act is added to the @testing-library/react import. The poll updates and the tab switch now land inside a barrier. The assertions, including the guard that the graph has samples before the plane flips, are unchanged.
  • website/integration/act-warning-baseline.json: removes only the src/test/SystemPage.test.tsx row. The list stays sorted, and the baseline only shrinks.

The test waits for the updates instead of filtering the warning. Test-only, no component change, and git merge-tree against main is clean.

Gates at this head: 0 failing checks, and every AI review lane passes. Backend Tests (3.12) shards and PR Readiness are still running, so auto-merge is pinned to this head and waits for them.

@bolichen97
bolichen97 enabled auto-merge (squash) November 2, 2026 07:10
@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Nov 2, 2026
@bolichen97
bolichen97 merged commit fac4c75 into main Nov 2, 2026
95 checks passed
@bolichen97
bolichen97 deleted the test/act-warnings-system-page branch November 2, 2026 07:42
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 2, 2026
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.

2 participants