summaryrefslogtreecommitdiffstats
path: root/docs/superpowers
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-08-13 10:00:31 +0200
committerDanilo M. <danix@danix.xyz>2026-08-13 10:00:31 +0200
commit9585674c9546079aa86f9943df39f700d8db331a (patch)
tree5d885eed06287ffcbbc05eacfd10d7d77a1751e0 /docs/superpowers
parentf119afe9a3d30f5d320b99c90b47fe52e7133d84 (diff)
downloadqtmaildir-9585674c9546079aa86f9943df39f700d8db331a.tar.gz
qtmaildir-9585674c9546079aa86f9943df39f700d8db331a.zip
test(mainwindow): stop the suite reading the real kernel lock table
Item 61. An init() fixture gives every test its own empty lock table in a QTemporaryDir, so no test observes the machine's real sync state. The failure was never intermittent in the usual sense: 0 failures in 30 runs with no lock held, 30 in 30 with one held. It presented as three tests failing that never mention syncing, and cost three misdiagnoses. The three tests that already used the seam each restored "/proc/locks" when finished, which was itself the defect: it handed the real table to whichever test ran next, so one test opting in re-exposed all the others. Those restores are gone and cleanup() leaves the temporary path in place. noTestCanSeeTheRealLockTable guards the fixture, since a silent revert would go back to failing for reasons no assertion mentions. Verified with the lock deliberately held: 3 failures before, 119/119 after, full suite 19/19. Mutation-checked by disabling the fixture, where the guard fails first and a real test fails behind it.
Diffstat (limited to 'docs/superpowers')
-rw-r--r--docs/superpowers/plans/2026-08-03-post-0.1.0-usability.md28
1 files changed, 27 insertions, 1 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 656773b..26464ba 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
@@ -117,7 +117,7 @@ taking that too literally.
| 58 | `message_zoom` documents a 0.5 to 3.0 range and enforces none of it | correctness | XS | **done** |
| 59 | Archive and Mark all read shipped with the same icon | presentation | XS | **done** |
| 60 | Next thread dead-ends on the last reply of an expanded thread | defect | XS | **done**; already fixed by 5487d58, see below |
-| 61 | `test_mainwindow` fails intermittently, about 1 run in 20 | testing | S | open; cause established 2026-08-11 (the user's cron sync holds the mbsync lock), fix is item 38's seam applied suite-wide |
+| 61 | `test_mainwindow` fails intermittently, about 1 run in 20 | testing | S | **done** 2026-08-13; an `init()` fixture points every test at its own lock table |
| 62 | No config option for the date format on a card | presentation | XS | **done** 2026-08-11 |
| 63 | No way to see sent mail, and no filter for it | workflow | M | **done** 2026-08-11; see `specs/2026-08-11-sent-mail-design.md` |
| 64 | The Sync button carries a mailbox icon, not a refresh one | presentation | XS | **done** 2026-08-11 |
@@ -4125,6 +4125,32 @@ initially mistaken for a regression that change had introduced.
**Size: S**, most of it in reproducing reliably rather than in the fix.
+### Outcome (done 2026-08-13)
+
+`TestMainWindow::init()` builds a `QTemporaryDir` per test and points
+`MainWindow::setLocksPathForTesting` at an empty file inside it, so no test
+reads the real `/proc/locks`. An empty table is the honest representation of
+"no sync is running"; the three tests that want to observe a sync write their
+own content, as they already did.
+
+**The three existing users of the seam each restored `"/proc/locks"` when they
+finished, and that restoration was itself a defect**: it handed the real table
+back to whichever test ran next, so one test opting in re-exposed every test
+after it. All three restores are removed, and `cleanup()` deliberately leaves
+the path pointing at the temporary file.
+
+`noTestCanSeeTheRealLockTable` guards the fixture, since a suite that silently
+reverts to the real table would go back to failing for reasons no assertion
+mentions.
+
+Verified rather than assumed, using the reproduction above. With
+`flock /tmp/mbsync.lock -c 'sleep 30'` held: 3 failures before
+(`aRefreshDoesNotStampOverASelectionMessage`,
+`anActionOnAMessageRowTagsThatMessageNotTheThread`,
+`aSuccessfulCronSyncDrainsTheEditedAccounts`), 119/119 after, and the full suite
+19/19 with the lock held. Mutation-checked by disabling the fixture: the guard
+fails first with its diagnostic, and a real test fails behind it.
+
## 62. No config option for the date format on a card
**Observed (user, from the notes):** "option in config file for date format".