Repository navigation
fix(plugin-form): the print row-cap test loads the line grid's body before its first render (#36640) - #36656
Merged
Conversation
…efore its first render (#36640) The cut-off case read the row count once, right after the row-ceiling note appeared. The note and the rows commit together, but the grid's body loads on first use (objectstack#36102), and the panel's mount-time preload is not awaited: a grid mounted before that load settles draws its loading face with no table, so the count read 0. Load the body at module scope, as the other line-grid tests do; the assertions are unchanged. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbZPB2pvoCNvwHycJan
Contributor
|
repo:objectstack#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj 维护者速读修好表单打印的一个偶发失败测试。它让主干每 4 小时一次的全量测试变红(#36649),也曾把别的 PR 踢出合并队列。 席位核对 — ACCEPT (L1) · repo:objectstack#1 · head
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Warren · project thread
Fixes #36640
Also the cause of #36649 (main's 4-hourly full run red at
e9fa6b5d06); that card closes when the next full run is green.What changes
ui/packages/plugin-form/src/__tests__/lineItemsPrintRowCap-11958.test.tsxloads the line grid's body at module scope (await preloadGridField()), before any test renders. No assertion is changed, removed, relaxed or retried; no timeout is touched; the file is not moved intoheavyDomTests. Test-only: no product code moves, so no changeset (needsskip-changeset).Why
Root cause, read from both failure logs and confirmed with a probe:
expected +0 to be 2), the single row count read right afterwaitForsees the row-ceiling note: the merge-queue run on PR feat(plugin-dashboard): a drill opens a centred dialog over the standard list, and a report's chart marks drill #36461 (reading 7092248222) and main's 4-hourly run 45135779472, job 137562669352 (Test UI (3/16),lineItemsPrintRowCap-11958.test.tsx:100:58). Lines 112 and 118 never failed.setRowCapandsetRowsare set in the same load callback inLineItemsPanel.tsx), but the grid's body is split out and loads on first use (objectstack#36102,ui/packages/fields/src/widgets/GridField.ts).LineItemsPanelstarts that load at mount withpreloadGridField()but does not wait for it, so a grid mounted before the load settles draws its loading face (data-testid="grid-field-loading", no table) while the note is already in the DOM.main(3cf6a44b):loadingFace=true tbody=false. The count of 0 is the loading face, not a missing or extra row.This is the case
ui/AGENTS.md§ 测试纪律 names: an assertion that lands behind a dynamicimport()loads that module at module scope, where the cost is outside every test window. Three sibling tests in this package already do exactly this (ModalForm.untypedRepeater.test.tsx,masterDetailSectionMembers-8071.test.tsx,deriveMasterDetail.declaredSpelling.test.tsx).Product side, considered and not changed: in the browser the note can sit under the grid's loading face only until the chunk that
preloadGridField()already requested arrives, and printing is a user-triggeredwindow.print(), so no printed page carries the note without its rows. The row cap and the note are unchanged.Verification
All counts on
objectstack-ai/objectstack, the 6-test file run alone withnpx vitest run --maxWorkers=2 packages/plugin-form/src/__tests__/lineItemsPrintRowCap-11958.test.tsxfromui/, 20 runs each, under load (one busy loop per core on a 4-core container, so the file runs against 4 CPU stressors):main3cf6a44bdraws the cap’s rows…, line 100,expected +0 to be 20c621d36Tests 6 passed (6)Run cold, as each fresh vitest run is, the load always loses the race; in CI's full run it loses only when the chunk's transform is slow, which is why the queue and the 4-hourly run saw it intermittently.
Also on
0c621d36: the wholeplugin-formpackage under--maxWorkers=2, 245 files / 2766 tests passed, 1 skipped (pre-existing);eslinton the changed file clean.Clause-②: no
Metadata-protocol: none
Human Minimum
packages/specholds no runtime logic. (not touched)pnpm lintpasses. (eslint on the changed file)main, one pull request.packages/spectouched: its generated artifacts are regenerated and committed. (not touched)content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.Generated by Claude Code