Skip to content

Commit 5968d89

Browse files
committed
test: harden sidebar overlay width tests against CI rebuild race
Remove an unnecessary prebuild step in SnapFX sidebar overlay width/resize-handle tests before reflective sidebar icon clicks. The prebuild can initialize SnapFX root state and allow icon-click handling to schedule an async sidebar rebuild ( equestRebuild()), which races the final scene build on CI and can fail at ew Scene(snapFX.buildLayout(), ...). Document the test hardening in status/roadmap/done/changelog notes and keep current test counts consistent.
1 parent 7f3a9cf commit 5968d89

5 files changed

Lines changed: 7 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ The changelog is grouped by release tags (`vX.Y.Z`) and includes an `Unreleased`
88

99
### Build and Test
1010
- ✅ Added `DockDebugOverlayTest` coverage for HUD layout defaults (managed pref-sized panel + background presence) and live target/zone diagnostics refresh when drag data mutates in place.
11+
- ✅ Hardened `SnapFXTest` sidebar overlay width/resize-handle tests against a CI-only async sidebar rebuild race by removing an unnecessary prebuild step before reflective sidebar icon clicks.
1112

1213
### Framework and UI
1314
- ✅ Fixed `DockDebugOverlay` HUD rendering and diagnostics behavior used by MainDemo debugging: the HUD panel now lays out correctly with visible background (no top-left clipping), and target/zone text updates live during active drags instead of staying at `none`.

DONE.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,13 @@ SnapFX has been fully implemented with core functionality and is production-read
8282
-`DockDragServiceTest` (8 tests) - D&D visibility, tab-hover activation, float-detach callback behavior, and ESC drag-cancel handling
8383
-`DockFloatingWindowTest` (31 tests) - Floating title-bar controls, context-menu behavior (attach/pin icons + attach action), floating-header sidebar move-menu callback forwarding, pin behavior, icon rendering/sync regression coverage, single-node float-menu policy, maximize/restore interaction behavior, scene-level drag continuity (including release/reset and non-primary guard behavior), resize-min constraints, interactive-target cursor reliability, and floating/main edge snapping behavior (including overlap-guard, adjacent-edge cases, and main-window shadow-inset compensation)
8484
-`DockFloatingSnapEngineTest` (6 tests) - Snap candidate scoring, overlap-aware candidate generation, and shadow-inset compensation coverage
85-
-`MainDemoTest` (24 tests) - Application icon resources, menu icon behavior, sidebar menu/list helper coverage for Phase-C manual controls, sidebar settings width-control API-parity wiring (including `DockSideBarMode` settings control), debug/settings outer-split divider-stability regression coverage, demo shortcut wiring, floating snap-target settings resolution coverage, load-error message formatting, owner-aware error-alert behavior, FileChooser helper coverage for shared layout/editor chooser configuration, and named theme-catalog/resource coverage
85+
-`MainDemoTest` (23 tests) - Application icon resources, menu icon behavior, sidebar menu/list helper coverage for Phase-C manual controls, sidebar settings width-control API-parity wiring (including `DockSideBarMode` settings control), debug/settings outer-split divider-stability regression coverage, demo shortcut wiring, floating snap-target settings resolution coverage, load-error message formatting, owner-aware error-alert behavior, FileChooser helper coverage for shared layout/editor chooser configuration, and named theme-catalog/resource coverage
8686
-`DemoNodeFactoryTest` (3 tests) - Unknown-node fallback strategy coverage (framework placeholder vs. demo custom fallback), plus SnapFX integration coverage for unsupported-type recovery with the default demo factory
8787
-`AboutDialogTest` (2 tests) - About dialog resources and credit link targets
8888
-`EditorCloseDecisionPolicyTest` (5 tests) - Deterministic close-decision behavior for dirty editor nodes
8989
-`MarkdownDocumentationConsistencyTest` (12 tests) - Documentation consistency guardrails
9090
- ✅ CI flake guard for critical interaction suites (`SnapFXTest`, `DockFloatingWindowTest`, `DockDragServiceTest`) runs 3x per CI execution
91+
-`SnapFXTest` sidebar overlay width/resize-handle tests no longer prebuild the layout before reflective sidebar icon clicks, avoiding a CI-only async `requestRebuild()` race before the final scene build
9192
- ✅ All tests passing (314/314) ✅
9293
-**Testing Policy** established (TESTING_POLICY.md)
9394
- ✅ Mandatory regression tests for all bug fixes

ROADMAP.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ This roadmap lists planned work only; completed/fixed history is tracked in `CHA
5757
-**Floating drag-state regression hardening**: Added scene-level drag release/reset and non-primary activation guard coverage for floating title-bar movement
5858
-**Persistence edge-case hardening**: Added complex floating snapshot roundtrip coverage and invalid floating snapshot validation/no-partial-apply tests
5959
-**CI flake guard for critical interactions**: CI now reruns `SnapFXTest`, `DockFloatingWindowTest`, and `DockDragServiceTest` three times per run
60+
-**Sidebar overlay width test CI race hardening**: `SnapFXTest` overlay-width/resize-handle tests avoid prebuilding `SnapFX` before reflective sidebar icon clicks, preventing an async sidebar `requestRebuild()` race before the final scene build on CI
6061
-**Floating reattach structure hardening**: Added three-window floating-layout detach/attach roundtrip regression coverage (top-left/top-right/bottom nodes), plus detach-close-remaining-attach host-restore fallback cases
6162

6263
**Estimated Time**: Completed

STATUS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@
149149
- ✅ DockGraphTest (69 tests, +11 regression tests plus sidebar model coverage) - Includes sidebar width preference defaults/validation/lock-policy coverage
150150
- ✅ DockLayoutSerializerTest (21 tests) - Includes strict load-failure diagnostics for blank content, malformed JSON, missing required fields, invalid tab selection metadata, unknown-node placeholder diagnostics, unsupported-type recovery with optional factory custom fallback, and sidebar persistence/restore-anchor/width roundtrip coverage (including legacy width fallback)
151151
- ✅ DockLayoutEngineTest (36 tests) - Includes tab/header/splitter context-menu coverage, representative container-tab title/icon behavior, float-availability policy checks, sidebar move-to-sidebar context-menu callback/lock-state coverage, hidden sidebar move-menu state when framework sidebar callbacks are unavailable, header-context-menu dismiss-on-press regression coverage, and tiny-bounds drop-zone clamp regression coverage
152-
- ✅ **SnapFXTest (94 tests)** - Hide/Restore + Floating Window API tests plus configurable shortcut behavior, floating-window snap API propagation/validation, side-bar facade API behavior (pin/restore, lock-aware pinned-open state, save/load roundtrip preservation), side-bar panel width API/roundtrip coverage, framework sidebar build-layout rendering structure coverage (collapsed strip vs. pinned/overlay panels, resize handle presence, width runtime clamping, right-overlay resize-handle pick/z-order regression coverage, and sidebar visibility mode rendering behavior for `AUTO`/`ALWAYS`/`NEVER`), configurable pinned-sidebar active-icon collapse policy coverage, sidebar-restore placement regression coverage for collapsed tab-parent fallback, sidebar strip/panel context-menu action and lock-state coverage, invalid-load failure handling, persistence edge-case coverage for complex floating snapshots, unknown-type layout recovery, unresolved floating-sub-layout D&D detach behavior, floating reattach placement restore/fallback behavior for both float-button and unresolved-drag detach paths, three-window floating-layout detach/attach roundtrip regression coverage (top-left/top-right/bottom cases), detach-close-remaining-attach host-restore fallback coverage, and theme stylesheet API behavior (initialize auto-apply + runtime switching + named theme catalog exposure)
152+
- ✅ **SnapFXTest (94 tests)** - Hide/Restore + Floating Window API tests plus configurable shortcut behavior, floating-window snap API propagation/validation, side-bar facade API behavior (pin/restore, lock-aware pinned-open state, save/load roundtrip preservation), side-bar panel width API/roundtrip coverage, framework sidebar build-layout rendering structure coverage (collapsed strip vs. pinned/overlay panels, resize handle presence, width runtime clamping, right-overlay resize-handle pick/z-order regression coverage, sidebar overlay width/resize-handle CI race hardening in tests, and sidebar visibility mode rendering behavior for `AUTO`/`ALWAYS`/`NEVER`), configurable pinned-sidebar active-icon collapse policy coverage, sidebar-restore placement regression coverage for collapsed tab-parent fallback, sidebar strip/panel context-menu action and lock-state coverage, invalid-load failure handling, persistence edge-case coverage for complex floating snapshots, unknown-type layout recovery, unresolved floating-sub-layout D&D detach behavior, floating reattach placement restore/fallback behavior for both float-button and unresolved-drag detach paths, three-window floating-layout detach/attach roundtrip regression coverage (top-left/top-right/bottom cases), detach-close-remaining-attach host-restore fallback coverage, and theme stylesheet API behavior (initialize auto-apply + runtime switching + named theme catalog exposure)
153153
- ✅ DockGraphSplitTargetDockingTest (1 test)
154154
- ✅ DockDragServiceTest (8 tests) - D&D visibility, tab-hover activation, float-detach callback behavior, and ESC drag-cancel handling
155155
- ✅ DockFloatingWindowTest (31 tests) - Floating title bar controls, context menu behavior (attach/pin icons + attach action), floating-header sidebar move-menu callback forwarding, pin behavior, icon rendering/sync regression coverage, single-node float-menu policy, maximize/restore interaction behavior, scene-level drag continuity (including release/reset and non-primary guard behavior), resize-min constraints, interactive-target cursor reliability, and floating/main edge snapping behavior (including overlap-guard, adjacent-edge cases, and main-window shadow-inset compensation)

src/test/java/com/github/beowolve/snapfx/SnapFXTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1533,7 +1533,7 @@ void testOverlaySideBarPanelUsesConfiguredWidthAndRendersResizeHandle() {
15331533
snapFX.dock(tool, main, DockPosition.RIGHT);
15341534
snapFX.pinToSideBar(tool, Side.LEFT);
15351535
snapFX.setSideBarPanelWidth(Side.LEFT, 420.0);
1536-
snapFX.buildLayout();
1536+
// Prebuilding here can schedule an async sidebar rebuild via icon-click handling and race the next buildLayout().
15371537
invokeSideBarIconClick(snapFX, Side.LEFT, tool);
15381538

15391539
Scene scene = new Scene(snapFX.buildLayout(), 800, 600);
@@ -1558,7 +1558,7 @@ void testRightOverlaySideBarResizeHandleIsPickableAndUpdatesWidth() {
15581558
snapFX.dock(tool, main, DockPosition.RIGHT);
15591559
snapFX.pinToSideBar(tool, Side.RIGHT);
15601560
snapFX.setSideBarPanelWidth(Side.RIGHT, 300.0);
1561-
snapFX.buildLayout();
1561+
// Keep rootContainer uninitialized until the final scene build to avoid async rebuild races in CI.
15621562
invokeSideBarIconClick(snapFX, Side.RIGHT, tool);
15631563

15641564
Scene scene = new Scene(snapFX.buildLayout(), 1000, 700);

0 commit comments

Comments
 (0)