Repository navigation
Conversation
… test React DEV invokes function components without props when building component stacks for warnings. Under load, an async state update lands outside act(), React logs the act warning, and the DragDropProvider mock captured undefined props, failing the renderMapLayerManager setup assertion. Fixes #1796
hl662
marked this pull request as ready for review
October 16, 2026 15:15
hl662
requested review from
a team,
eringram and
mdastous-bentley
as code owners
October 16, 2026 15:15
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The narrow, test-only fix addresses the reported failure with no unresolved findings.
0 open findings
What changed in this PR
Fixes the map-layers test setup flake behind #1796 without changing production behavior.
Changes:
- Preserves captured provider props during React’s diagnostic calls without props.
- Re-enables the skipped drag-order restoration test.
| File | Description |
|---|---|
packages/map-layers/src/test/MapLayerManagerDragDrop.test.tsx |
Guards mock props capture and restores the skipped test. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
TL;DR
MapLayerManagerDragDrop.test.tsxfails intermittently in CI under load. The cause is in the test's mock: React's dev build calls component functions with no props when it builds component stacks for warnings, and theDragDropProvidermock saved thoseundefinedprops over the real ones. The mock now ignores those calls, and the test skipped for #1796 is re-enabled.Fixes #1796
Why
The setup helper
renderMapLayerManagerchecks that the mockedDragDropProviderreceived its props (line 84). That check failed at random in CI: in both runs linked from #1796, and in four CI runs on #1826/#1828 this week. #1797 skipped the first test, but the failure just moved to whichever test ran first, because the problem was in the shared setup, not in the drag behavior.The failure sequence:
render()mountsMapLayerManager, and the mock saves the provider's props.MapLayerManagerlands outsideact(), so React logs the "not wrapped in act(...)" warning. The package's vitest config hides that warning from the console.describeNativeComponentFrame) calls each component in the tree with no arguments. The mock runs again and savesprops === undefined.Step 2 depends on timing, which is why the test failed under CI load but passed locally.
What
DragDropProvidermock only saves props when it receives themrestores the drag-start layer order when the pointer leaves all droppablesTesting
Reproduction and validation
To make the flake show up reliably, I ran 30 copies of the test file in one vitest run with coverage,
--maxWorkers=8, and every CPU core saturated byyesprocesses.describeNativeComponentFrame, settingundefinedvitest --run --coveragefor map-layerspnpm lintfor map-layersThis is a test-only change, so there's no changeset.
Nambot 🤖 (powered by claude-opus-5.5)