summaryrefslogtreecommitdiffstats
path: root/docs/superpowers
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-08-06 19:32:22 +0200
committerDanilo M. <danix@danix.xyz>2026-08-06 19:32:22 +0200
commiteef7f6cc1b2f845d2ca1eba53336f64597c49e62 (patch)
tree61a2168834a623c1afa5e898996f8ae036e44d36 /docs/superpowers
parentddb4ac26b7fb553c9349401dda4510636c67cc9b (diff)
downloadqtmaildir-eef7f6cc1b2f845d2ca1eba53336f64597c49e62.tar.gz
qtmaildir-eef7f6cc1b2f845d2ca1eba53336f64597c49e62.zip
test: stop two tests depending on the machine they run on
Both are the same class of defect: a test that reads real machine state and so passes or fails on circumstance rather than on the code under test. Item 38. Every MainWindow a test builds constructed its SyncMonitor on the live /proc/locks, so a window observed the machine's actual sync state and the sync-button assertion failed whenever the user's cron sync happened to be running. Cron fires every ten minutes and a run lasts ~35s, which is roughly 6% of runs, and it read as flakiness. SyncMonitor already took an injectable locks path for exactly this; MainWindow did not expose it. It does now, as a test seam rather than a config key: /proc/locks is not something a user would set, and a wrong value silently disables background sync detection instead of failing loudly. The monitor is still constructed and started, per the item's own constraint. Only the table it reads is redirected, to an empty file in the test's own temporary directory. Item 46. uiStateSurvivesARestart asserted a 940px width, and the offscreen platform reports an 800x800 screen. restoreGeometry() clamps to the available area, so the width came back as 798 while the 620 height, which fits, restored untouched. That asymmetry was the tell that persistence was fine and the test was wrong. The size is now 640x560 and carries no meaning beyond differing from the default. Verified by reproducing the original conditions rather than by waiting for them: the suite run under flock -n /tmp/mbsync.lock fails item 38's assertion with the seam bypassed and passes with it in place, and item 46 now passes under offscreen where it failed. One dud mutation is recorded in the backlog, writing an unparseable line into the injected lock table does not fail the test, because lockHeldIn() correctly finds no lock in it. Suite: 15/15 offscreen with the lock held, and green on Wayland except the pre-existing querycompleter screenshot flake, which fails to grab under Wayland and passes offscreen.
Diffstat (limited to 'docs/superpowers')
-rw-r--r--docs/superpowers/plans/2026-08-03-post-0.1.0-usability.md38
1 files changed, 36 insertions, 2 deletions
diff --git a/docs/superpowers/plans/2026-08-03-post-0.1.0-usability.md b/docs/superpowers/plans/2026-08-03-post-0.1.0-usability.md
index 0186bfa..dd6a8ca 100644
--- a/docs/superpowers/plans/2026-08-03-post-0.1.0-usability.md
+++ b/docs/superpowers/plans/2026-08-03-post-0.1.0-usability.md
@@ -85,7 +85,7 @@ taking that too literally.
| 35 | No refresh of the thread list after a sync | workflow | M | open |
| 36 | `test_mainwindow` cannot reach the worker | testing | S | open, on demand |
| 37 | The worker stalls on a tag edit made during a background sync | correctness | S | **done** |
-| 38 | `test_mainwindow` fails when a real sync holds the lock | testing | XS | open |
+| 38 | `test_mainwindow` fails when a real sync holds the lock | testing | XS | **done** |
| 39 | Thread list cannot be sorted by clicking a column header | workflow | S | open |
| 40 | No live filter over the current view | workflow | M | open |
| 41 | A message whose HTML body carries a `Content-Id` renders blank | correctness | S | open |
@@ -93,7 +93,7 @@ taking that too literally.
| 43 | No "Mark all read" for the current view | workflow | S | open |
| 44 | No way to manage the filters applied at sync time | workflow | ? | open, unspecified |
| 45 | Two Sync buttons on the main window | discoverability | XS | open |
-| 46 | `uiStateSurvivesARestart` fails under the offscreen platform | testing | XS | open |
+| 46 | `uiStateSurvivesARestart` fails under the offscreen platform | testing | XS | **done** |
Sizes are rough: XS under an hour, S a sitting, M a session.
@@ -1917,6 +1917,30 @@ are unaffected either way; it is only the construction-time state that leaks in.
construction-time state IS the behaviour under test for this case, and a window
that never polls would pass the assertion for the wrong reason.
+### Outcome (done)
+
+`MainWindow::setLocksPathForTesting()` / `locksPath()` give the window the seam
+`SyncMonitor` already had, and the test points it at an empty file in its own
+`QTemporaryDir` so construction observes no sync. The constraint above is
+respected: the monitor is still constructed and still started, it simply reads a
+lock table the test controls.
+
+**A test seam, deliberately not a config key.** `/proc/locks` is not something a
+user would ever set, and a wrong value fails silently by disabling background
+sync detection rather than loudly. A `[general]` key was considered and rejected
+for that reason.
+
+**The override is process-wide and is reset at the end of the test**, since the
+`QTemporaryDir` holding the file is destroyed with it; leaving it set would
+point every later window at a path that no longer exists.
+
+**Verified by reproducing the original failure rather than waiting for cron.**
+Running the suite under `flock -n /tmp/mbsync.lock` fails the assertion exactly
+as reported when the seam is bypassed, and passes with it in place. The first
+mutation attempted was a dud worth recording: writing `MUTANT` into the injected
+lock table does not fail the test, because it is not a parseable `/proc/locks`
+line and `lockHeldIn()` correctly finds no lock in it.
+
## 39. Thread list cannot be sorted by clicking a column header
**Observed (user, 2026-08-05):** "left pane columns order by clicking on the
@@ -2207,6 +2231,16 @@ the property under test (the size that went in comes back out) is exact.
the machine they run on, and both were found by running the suite in a context
its author had not tried rather than by reading it.
+### Outcome (done)
+
+The asserted size is now 640x560, which fits the offscreen platform's 800x800
+screen. Nothing in `MainWindow` changed: the persistence was never broken, only
+the test's choice of a window wider than the smallest screen it runs against.
+
+Verified both ways round, since this one passed on Wayland throughout: 45 of 45
+under offscreen where it previously failed, and still green on the real
+platform.
+
## Deferred, unsized, or split out
Items noted while triaging but not part of the original list. Same numbering