From 889991b15f9ed3af3ed4e7e783dc832ef9c3e929 Mon Sep 17 00:00:00 2001 From: yetone Date: Wed, 18 Nov 2026 06:46:41 +0800 Subject: [PATCH] lessons: a record is written once its run has ended, seen a third day (11-18) 97e0ecdaa recorded the whole GUI suite as "still running at push: 3736 tests in, 127 red" and left "the rest" of the reds to another session's rerun. The lesson (10-17 5b12407e8, 10-28 ca9b5048e) is now seen on three days, so it moves into docs/code-standards.md's Tests table and LESSONS.md's "Moved to the code standards" list. Docs only; nothing run. --- LESSONS.md | 11 ++++++++++- docs/code-standards.md | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/LESSONS.md b/LESSONS.md index 8f4bd4495..e8130302e 100644 --- a/LESSONS.md +++ b/LESSONS.md @@ -484,7 +484,13 @@ back every line after it, and the log moves in bursts. which isn't among the five it names (a8098a886). Write the record once the run has ended. A change that adds a box that scrolls on its own runs every GUI file that wheels the page (`reach`, `wheelTo`). -- Seen 2× (2026-10-17, 2026-10-28). +- 11-18: 97e0ecdaa (saved-proxy Test) recorded the whole GUI suite as + "still running at push: 3736 tests in, 127 red, none in a proxy or + provider file", named issues for some files and left "the rest" to + another session's rerun. A red counted before the run ends can't be + told from one the change made later in the same run. +- Seen 3× (2026-10-17, 2026-10-28, 2026-11-18); moved to the code + standards. **A red only CI's OS shows is probed on CI's runners, with the suspect switched on and off, not rerun.** Start from what changed in @@ -1248,6 +1254,9 @@ standards since 10-18, widened to a worktree and its logs. See ## Moved to the code standards +- **A record is written once its run has ended** (10-17, 10-28, + 11-18). On 11-18 97e0ecdaa was pushed with the GUI suite at 3736 + tests and 127 red, "the rest" of them left to another session. - **One full suite runs on a machine at a time** (10-16, 10-17, 11-16). On 11-16 64c426158 ran the GUI suite on mica beside another session's full suite, was pushed with it still running, and named its 90 reds by diff --git a/docs/code-standards.md b/docs/code-standards.md index 28d8f6a05..d0318abb6 100644 --- a/docs/code-standards.md +++ b/docs/code-standards.md @@ -35,6 +35,7 @@ describe and review a change to a subsystem is in the | Tests stay out of the real machine. | Run them under a temp HOME with Go's caches pinned (see the snippet in [provider-plugins.md](subsystems/provider-plugins.md)). Never touch a real agent's config or `~/.config/magpie`. An agent's variable goes in `agentenv.Vars`, so the sandbox clears it. | | Whatever a test starts ends when the test does. | A fake process, a goroutine or an async refresh a test sets going is stopped or waited for before the test returns, or it writes into the next test's folder ("directory not empty") or spins for days. A package that isolates itself in its own `TestMain` instead of `testenv.Run` sets what testenv sets, `testenv.Marker` included. TestClaudeSignInByPaste's fake polled for 2 days (38a0f470). On 10-11 a CLI-identity ask outliving its test broke the next one (#1524): 4ee3a76b fixed it in internal/gateway only, 9c377231 for every package through the marker, which the gateway never set (a349de82). | | One full suite runs on a machine at a time. | A full `go test ./...` or GUI suite waits for the one already running on that machine (mote, then mica), and a record from a run beside another suite is not a pass. Its reds are named with an issue each, not "files this change doesn't touch". On 10-16 three suites from one session at load 300 to 400 all timed out (#2557). On 10-17 three `go test ./...` runs and ~35 GUI runners shared one box, and a run's Go cache was trimmed mid-run by another (#2544, #2645). On 11-16 64c426158 ran the whole GUI suite on mica beside another session's full suite and was pushed with 90 reds named only by page (accounts, Details, keys, plugins, providers). | +| A record is written once its run has ended. | A body names the result of a run that finished: "still running at push" or "N in, M red when this was written" is not a record, and every red in it is named with its issue. ca9b5048e (10-28) recorded 531 ok and 5 red with its run going on, and routing-model-rest, not among the five, went 20 of 20 red (a8098a886). On 11-18 97e0ecdaa recorded 3736 tests in and 127 red, named issues for some files and left the rest to another session's rerun. | | A timing test leaves room on both sides. | Never bound a test by wall-clock time a loaded runner can exceed, and keep a threshold classifier's fixture far from every threshold it has. Reproduce a timing failure by injecting the delay (a held write, a late first arrival), not by rerunning until it fails, and list every timing assumption in the test when fixing one. 319b72c7 fixed one of two loops sharing a 2000-line bound and the other went red 9h later (229ce19a). On 10-11 TestMaxRPM's flake was a real gap: a first request that reached the vendor late let the vendor see one too many in its minute (ce1ecaa4), and the queued-stream tests timed the client's clock under CPU starvation (3f4287e6). | ## Acceptance criteria