Skip to content

flaky: DatasetWidget.dottedDimensionTable's "issues the ONE read" case asserts a fetch AFTER waiting only on the rendered cell #4487

Description

@yinlianghui

Observed on an unrelated PR (#4485, the plugin-chatbot DOM-prop whitelist — it touches no dashboard code). Test (shard 1/4) went red on:

FAIL dom packages/plugin-dashboard/src/__tests__/DatasetWidget.dottedDimensionTable.test.tsx
  > renders a LOCAL-only table exactly as the server sent it, and issues the ONE read (#4330)
AssertionError: expected [] to deeply equal [ 'crm_opportunity' ]
- [ "crm_opportunity" ]
+ []
 ❯ packages/plugin-dashboard/src/__tests__/DatasetWidget.dottedDimensionTable.test.tsx:207:23
 Test Files  1 failed | 331 passed (332)

Job: https://github.com/objectstack-ai/objectui/actions/runs/31632075546/job/94233072634 (shard duration 329.91s, import 650.16s — a saturated run).

Not the change under test, and not reproducible in isolation:

The race, as the source reads

await waitFor(() => expect(firstRowCells()[0]).toBe('Education'));
expect(requested).toEqual(['crm_opportunity']);

The wait is on the RENDERED CELL, but the assertion is about a metadata READ recorded by installMetaRouter. On the local path the row renders from the server's own rows — it does not depend on that read having resolved or even having been issued — so the two are only incidentally ordered. Under load the render wins and requested is still empty. This is AGENTS.md 测试纪律's profile exactly: an unbounded async step judged inside a window bounded by something else.

Not a timeout bump

AGENTS.md forbids fixing this class by raising a timeout or moving the file into heavyDomTests — both hide the race. The fix is to wait on the thing being asserted, e.g. await waitFor(() => expect(requested).toEqual(['crm_opportunity'])), keeping the rendered-cell assertion as its own step. The "exactly ONE read" property (the point of the case, per #4330) is preserved: a waitFor on set equality still fails on a second read.

Filed unassigned while implementing #4431; not fixed there — out of that card's surface.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions