test(display): de-flake the dock harness re-dock assertion (#154)
All checks were successful
Check / eval (push) Successful in 4m16s

tools/monitor-fallback.nix flaked at the #148 reload-mid-dock step: after
a lid-closed `hyprctl reload` re-lights the disabled Virtual-1 panel, the
watcher's enforce_dock_intent re-disables it — but only on the loop's 1s
idle tick, because re-enabling an existing connector emits no
`monitoradded` and the chatty IPC events `continue` past reconcile. Under
this softGL VM's load (swaync crash-loops against the absent Vulkan
device) that idle tick is starved, so the re-dock lands ~15-20s out —
right on the old timeout=15.

An instrumented run confirmed the mechanism is correct: dockMode=true is
read, `action=re-dock` fires, the panel is re-disabled (it just missed the
bound). Fix is the bound, not the watcher: 15s → 45s, in line with the
test's own 20-30s waits. Harness now green end-to-end (~61s).

Not a product bug and independent of the #150 extraction (the built
transition/keyboard tools have byte-identical store paths across it).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-20 19:40:28 +01:00
parent baf2cd2e13
commit 3536abc656
3 changed files with 27 additions and 27 deletions

View File

@@ -175,27 +175,6 @@ If that count is zero over a few weeks post-linger, **close this unbuilt**. If i
is not, the upstream issue has sat ten months on vaxerski's "that will cause a is not, the upstream issue has sat ten months on vaxerski's "that will cause a
segfault no?" and a reproducer would be worth more than a local guard. segfault no?" and a reproducer would be worth more than a local guard.
### 154. `[watch]` `tools/monitor-fallback.nix` is red on `main` at the #148 reload-mid-dock assertion
Found while verifying #150 (2026-07-20): the dock/undock VM harness fails at
the `enforce_dock_intent` step — after a lid-closed `hyprctl reload` it waits
15s (generated `<string>:75`) for the watcher to re-disable `Virtual-1` and
times out; the panel is never re-disabled and `action=re-dock` is never
logged. **Confirmed pre-existing:** a clean-HEAD worktree run
(fdf9790, before any #150 change) fails at the *identical* assertion, and the
#150 refactor is proven inert here (the built `nomarchy-display-transition` /
`nomarchy-keyboard-layout` have byte-identical store paths on HEAD vs the
#150 branch). The `dock` transition itself succeeds (`result=ok`, both
workspaces move, internal disabled) — only the post-reload re-dock invariant
fails. Likely a harness/environment issue (the `enforce_dock_intent` tick
depends on the watcher reading `settings.display.dockMode` from the in-flake
state, which may not be writable in this NixOS-test sandbox) rather than a
product regression — but it means the maintainer V2 dock harness is not a
usable gate until re-greened. Do first: reproduce, then check whether
`set_dock_intent` actually persists `dockMode=true` inside the VM (grep the
run journal for `dock-intent=…state-write-failed`); if the state write is the
gap, the fix is in the harness, not the watcher.
### 149. `[watch]` Waybar's exec-once workaround may be defending against nothing post-linger ### 149. `[watch]` Waybar's exec-once workaround may be defending against nothing post-linger
Spun out of #147 (shipped 2026-07-17) so its loose thread survives the entry: Spun out of #147 (shipped 2026-07-17) so its loose thread survives the entry:

View File

@@ -541,11 +541,25 @@ Design/decision records and a running log of shipped work (items marked
`nomarchy-display-transition` / `nomarchy-keyboard-layout` on HEAD vs the `nomarchy-display-transition` / `nomarchy-keyboard-layout` on HEAD vs the
refactor. Gates: parse + home/toplevel builds + `checks.docking-ux` refactor. Gates: parse + home/toplevel builds + `checks.docking-ux`
(structural, `bash -n` + safety-feature greps) all green. The (structural, `bash -n` + safety-feature greps) all green. The
`tools/monitor-fallback.nix` dock VM harness is **red on `main` already** `tools/monitor-fallback.nix` dock VM harness was **red on `main` at the
(the #148 reload-mid-dock assertion — identical failure on clean HEAD; time** — a flaky 15s bound on the #148 re-dock (identical failure on clean
BACKLOG #154), so it could not gate this; the dock transition inside it HEAD), diagnosed and fixed the same day (see below), so it did not gate this
still ran `result=ok`. The idle wake-path behaviour change (full undock, landing; the dock transition inside it always ran `result=ok`. The idle
incl. dock-intent clearing + `restore_keyboards`) is V3 — HARDWARE-QUEUE. wake-path behaviour change (full undock, incl. dock-intent clearing +
`restore_keyboards`) is V3 — HARDWARE-QUEUE.
- ✓ **Dock harness de-flaked (#154, 2026-07-20):** `tools/monitor-fallback.nix`
flaked at the #148 reload-mid-dock assertion — after a lid-closed
`hyprctl reload` re-lights the disabled `Virtual-1` panel, the watcher's
`enforce_dock_intent` re-disables it, but only on the loop's 1s **idle
tick** (a reload re-enables an existing connector, emitting no
`monitoradded`, and chatty IPC events `continue` past `reconcile`). Under
the softGL VM's load — swaync crash-loops against the absent Vulkan device —
that idle tick is starved and the (correct, prompt-on-hardware) re-dock
lands ~15-20s out, right on the old `timeout=15`. Instrumented run proved
the mechanism fires with `dock-intent=true` and re-disables the panel; fix
is the bound (15→45s, matching the test's other 20-30s waits), not the
watcher. Harness now green end-to-end (61s). Not a product bug and unrelated
to #150 (byte-identical tool store paths).
- ✓ **The idle brick's CAUSE found (#127 closed, 2026-07-17):** the incident - ✓ **The idle brick's CAUSE found (#127 closed, 2026-07-17):** the incident
was misdated — it did not happen "before 12:51:34 Jul 15" (that boot was was misdated — it did not happen "before 12:51:34 Jul 15" (that boot was
healthy all day and ended in a routine clean reboot); it ended the healthy all day and ended in a routine clean reboot); it ended the

View File

@@ -140,8 +140,15 @@ pkgs.testers.runNixOSTest {
# re-dock action. # re-dock action.
machine.succeed("printf 'state: closed\\n' > /run/nomarchy-test-lid-state") machine.succeed("printf 'state: closed\\n' > /run/nomarchy-test-lid-state")
machine.succeed(hy + "reload'") machine.succeed(hy + "reload'")
# A reload re-lights the *already-present* (disabled) Virtual-1 connector,
# which emits no `monitoradded` so the watcher only re-disables it on its
# 1s idle tick (chatty IPC events `continue` past reconcile). Under this
# softGL VM's load (swaync crash-loops on the absent Vulkan device, see the
# journal) that idle tick is badly starved and the re-dock lands ~15-20s
# out a real, prompt re-dock on hardware, but right on the old 15s bound,
# so this flaked. Bounded generously, in line with the 20-30s waits above.
machine.wait_until_succeeds( machine.wait_until_succeeds(
hy + "-j monitors' | jq -e 'all(.[]; .name != \"Virtual-1\")'", timeout=15 hy + "-j monitors' | jq -e 'all(.[]; .name != \"Virtual-1\")'", timeout=45
) )
machine.succeed("journalctl -t nomarchy-display-watch | grep -q 'action=re-dock'") machine.succeed("journalctl -t nomarchy-display-watch | grep -q 'action=re-dock'")
print("reload-mid-dock: panel re-disabled by enforce_dock_intent; re-dock logged (#148)") print("reload-mid-dock: panel re-disabled by enforce_dock_intent; re-dock logged (#148)")