Tests wait for what they assert, not the first paint; backup tests build their own schema; one changelog block each (R5, B9) #803
Loading…
Reference in a new issue
No description provided.
Delete branch "build/test-race-audit"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
R5 from the B-questions (B9: the test-race audit). There is no product change.
Frontend: 20 racy tests in 5 files
Every flaky test this week had the same shape: the test waited for the first thing, then asserted a later thing. The audit checked:
expect(await findBy…).toHave…sites;It fixed the real ones:
Profile.test.jsxandNotifications.test.jsx: the sharedopen()helper waited for.doc, which is on the first paint. The sections behind it load after mounting, behind a Busy line.open()now also waits until nothing is busy. This covers 17 tests.AppFrame.test.jsx: the footer's version comes from/api/metaa render after the footer exists. The test now waits on the text, not the element.NewCampaign.test.jsx: it renders a lazy route. It now warm-imports the page inbeforeAll, likeHome.test.GeneratorPanel.test.jsx: the clock is faked withshouldAdvanceTime, so real runner delay adds to it. The test now asserts at least 4s, not exactly 4s.Sites judged not racy, where the element and its asserted state land in the same render, are listed in the audit report. No product race was found.
Backend:
test_backup_tasks.pyfailed on its ownIt writes through
AsyncSessionLocaland never asked for theenginefixture, which is the only thing that creates the tables. It passed in a full run only because an earlier module had built the schema.engine, and clears the committed backup config after each test.test_audio_tasks.pyhad the same bug, and is fixed the same way.relation "app_settings" does not exist). After: passes on its own and in the full suite (4099 passed, 13 skipped).CHANGELOG
[Unreleased]had grown a second**Added**/**Fixed**pair. Its entries are folded into the first blocks, with no wording changed.Checks
Frontend. Five stress runs on the audit's tree, all 142/142 files:
--maxWorkers=1;--maxWorkers=8.After merging main: 143 files, 2017 tests passing. Lint: 0 errors, and the warning count is unchanged at 228.
Backend. Ruff 0.4.4 format and check are clean.
🤖 Generated with Claude Code