Repository navigation
Reproduce a macOS-only failure on CI's Mac with a ci dispatch that names its tests - #6434
Conversation
…as flake copies A dispatch of ci given `flake` skips the Linux suite and runs `leaf-dev suite flake` with those arguments on test-macos in place of the suite, so a session reproduces a failure only the nightly macOS job shows without pushing a branch that edits this workflow. `leaf-dev suite flake` takes --copies and --workers, which were constants, for the repeat count and the load.
…ting on the maintainer running-tend said a failure only test-macos shows waits on the maintainer, since no runner Tend reaches has macOS, and that the Linux checks suffice before merging its fix. CI's macOS runner is reachable through a dispatch of ci, which now takes the tests to run as `flake`. Triage reproduces such a failure itself, and proves its fix with the same dispatch failing on the base and passing on the fix; the next scheduled run remains the evidence only where no dispatch reproduces it. tests/AGENTS.md, Races, gives the dispatch beside the local ways to reproduce a load failure.
`leaf-dev suite flake --load N` runs N busy loops in the copies' band for as long as the copies run, each spinning only while the command is its parent. A copy's demand for CPU comes and goes, so copies alone starve a test less steadily: on CI's macOS runner, the WebKit marks failure (tests/browser/navigation/test_comment_marks.py, before #6415) showed in 1 of 18 copies run six at a time, where serial runs beside four busy loops showed it in 17 of 20.
…n more copies On CI's macOS runner, the WebKit marks test at #6415's parent failed in 18 of 20 copies run one at a time beside four --load loops, against 1 of 18 copies run six at a time with no loops.
…spatch on a branch A copy's checkout, and with it the pictures its failing browser tests left under .tmp/test-results/screens/, went when the copy ended, so a dispatch's artifact held logs but no pictures; each copy's pictures now move into the run's directory. A busy loop takes its parent's pid as an argument, so a loop started after the command died ends rather than spinning under pid 1. A red ci run on main files a CI failure report, which starts triage, so Races and running-tend dispatch a base on a branch of its own. running-tend asks for enough passing copies on the fix that the base's failure rate would have failed three of them, and names the macOS dispatch in one place. The ci.yaml step points at flake's --help rather than restating its options.
# Conflicts: # .github/workflows/ci.yaml
ec54c6f to
07bd2c5
Compare
…s declared draft (#6450) `test_every_part_of_a_floating_box_moves_one_way_per_input[firefox_browser]` hung for 30 minutes inside a Playwright call in the Nov 18 macOS nightly, until the suite's timeout ended its worker. Two harness faults in the test, both fixed here: - **Every example's page stayed open.** Each Hypothesis example opens a page and none closed one, so every example's page stood, live and polling, until the test ended, and on a starved runner Firefox stopped answering. Each page now closes once its frames are read. - **Examples inherited each other's words.** The examples share one page server, which keeps the words each one typed as the page's draft. An example with `draft=''` skipped `write`, so its field opened holding every earlier example's words, with the caret wherever the click landed. Each example now writes its declared draft, an empty one included. The second fault surfaced when the first fix made this PR's Linux `test` job fail in both engines. Closing the page didn't cause that failure. `derandomize` seeds Hypothesis from the example function's source, so adding the `page.close()` call drew a different set of examples. Closing pages from the outer test instead, which leaves that source unchanged, drew main's examples and passed. main's file with only a print added, closing nothing, drew yet another set and failed the same way. The new draws reached a field holding inherited text below the caret, and deleting a line there jerks. **The jerk is the product's, and this PR leaves it.** In the floating panel's field or a card's reply field, deleting a line with lines below the caret draws those lines a line higher for a frame, then glides them back. It happens at full speed in both engines; the comment box beside a passage doesn't do it. `box-motion.js` carries the editor's words by the field's start edge, which suits the lines above a removed line and not those below it. With every example's field holding what it declares, the test never puts lines below the caret, so it passes without covering this case. Evidence: - **Hang, before:** on CI's macOS runner (the dispatch input #6434 adds), 16 copies run four at once all failed ([run 44415075477](https://github.com/max-sixty/leaf/actions/runs/44415075477)). 10 hung to the 30-minute limit waiting on Playwright, as in the nightly; 6 timed out on a click, a `goto` or the probes' module load. - **Hang, after closing pages:** 8 copies run four at once hung none and finished in 15 minutes ([run 44431285495](https://github.com/max-sixty/leaf/actions/runs/44431285495)). 7 failed on the inherited-words jerk above. - **Both fixes, locally:** the test passes in Chromium and Firefox. On CI's macOS runner, 8 copies run four at once passed 8 of 8 in Firefox ([run 44442357545](https://github.com/max-sixty/leaf/actions/runs/44442357545)) and 8 of 8 in Chromium ([run 44442361283](https://github.com/max-sixty/leaf/actions/runs/44442361283)), and this PR's Linux `test` job passes. Refs #6392. > _This was written by Claude Code on behalf of max-sixty_
`test_an_armed_page_shows_each_place_the_cursor_its_press_keeps[firefox_browser]`
failed in the Nov 17 and Nov 18 macOS nightlies, reading a hand on the
draft's item at rest (`['pointer', 'pointer']`). The test left Design
mode with one Escape after resting the pointer on each place in turn. On
a slow machine the rest on the link outlasts the preview's 200 ms dwell,
so the link's preview shows, and it still stands when Escape arrives.
Escape puts the preview away, as `browser/runtime/keyboard/AGENTS.md`
("Escape") says it should, and Design mode stays on. The ⌥-click that
follows takes the draft's item in Design mode, whose hand stays after ⌥
comes up. The page does what the contract says; the test assumed no
preview stood.
The test now waits for Design mode to stand after `l`, leaves it with
`l`, which puts a preview away and leaves the mode in one press, and
waits for it to end.
Evidence:
- **Before, on CI's macOS runner** (the dispatch input #6434 adds): the
test alone failed in 3 of 16 copies run four at once ([run
44408705940](https://github.com/max-sixty/leaf/actions/runs/44408705940)),
and in 3 of 4 copies of the 43 Firefox tests the nightly's worker ran
before it ([run
44408713046](https://github.com/max-sixty/leaf/actions/runs/44408713046)).
A probe that logged the page's events showed Escape delivered and the
Design legend still up at the failing reading, in each failing copy
([run
44419223004](https://github.com/max-sixty/leaf/actions/runs/44419223004)).
- **Locally, deterministic:** resting 400 ms on the link before the
Escape fails the test at full speed on this Mac in 3 of 3 runs, and
passes 3 of 3 with this change. Its event log shows the link's preview
open when Escape arrives, closing on it, and the Design legend staying.
- **After, on CI:** the test alone passed 16 of 16 copies four at once
([run
44421651157](https://github.com/max-sixty/leaf/actions/runs/44421651157)),
and 4 of 4 after the 43 Firefox tests ([run
44421672607](https://github.com/max-sixty/leaf/actions/runs/44421672607)).
Two other tests failed in that second run, neither touched here:
`test_a_preview_covers_no_neighbour_and_takes_the_pointer_in_a_modal[firefox_browser]`
in 3 of 4, which passed 4 of 4 on main before today's later merges, and
`test_the_comment_box_comes_back_to_where_its_passage_starts[firefox_browser]`
in 1 of 4, on a Firefox module-load warning with the runner's address
held.
Refs #6303.
> _This was written by Claude Code on behalf of max-sixty_
…date (#6436) #6415 made `test_o_gives_marked_words_their_own_colours_back` read the re-shown link mark after a rendering update, since WebKit can screenshot words before it paints a highlight just registered. The test's first reading has the same race. It reads the unmarked string's syntax colour right after `lf-token-syn-string` is registered, and on a starved macOS runner WebKit hadn't painted it yet, so the string read grey `(74, 78, 83)`; the hidden-annotations check then compared the marked string's correct blue `(29, 79, 107)` against that grey and failed. The test now waits for `rendered` after each scheme change, before that reading. It's a test fix: WebKit does paint the colour. Evidence, from CI's macOS runner running only this test as 20 copies one at a time beside four busy loops (`flake="--workers 1 --load 4 …"`, the dispatch input #6434 adds): main failed it at this reading in 17 of 20 ([run 44407433212](https://github.com/max-sixty/leaf/actions/runs/44407433212)) and, after today's later merges, in 15 of 20 ([run 44410667696](https://github.com/max-sixty/leaf/actions/runs/44410667696)), and this change passed 20 of 20 ([run 44410662485](https://github.com/max-sixty/leaf/actions/runs/44410662485)). The nightly hasn't shown this reading fail; the load here is harsher than the nightly's. Refs #6303. Found while checking that the new dispatch input reproduces the failure #6415 fixed. > _This was written by Claude Code on behalf of max-sixty_
`leaf-dev suite flake` ran each copy and each `--load` loop in macOS's background band, which exists so a run on a shared Mac yields to its other users. A CI runner has none, and there the band starved a fresh runner's first round of copies several times over: the same eight copies of `test_a_line_removed_among_the_words_moves_only_what_layout_moved`, dispatched at the same moment, took 108 to 216 s per test in the first round and 22 minutes in all in the band (run 44487043988), and 9 to 38 s per test and 5 minutes at normal priority (run 44487039963). The first round's tail produced failures the nightly, which runs at normal priority, never shows: a 120 s click whose page had taken it, and `Page.goto` and `Page.reload` timeouts. So where `CI` is set, as GitHub Actions sets it, the copies and loops now run at normal priority; on a shared Mac they keep the band. > _This was written by Claude Code on behalf of max-sixty_
# Conflicts: # .claude/skills/running-tend/SKILL.md
leaf-agent
left a comment
There was a problem hiding this comment.
Since 6faaf87d, a dispatch runs the copies and --load loops at normal priority, because BACKGROUND is empty where CI is set. Races still describes the background band, and so does the evidence behind its example. Both dispatches the PR body cites ran at 5a2f3cd0, before that commit: 1 of 18 with no loops, and 18 of 20 under --workers 1 --load 4. That commit's own message shows how much the band did. In the band, the first round of copies took 108–216 s per test. At normal priority it took 9–38 s. So the example command this PR recommends hasn't been shown to reproduce the WebKit failure in the conditions a dispatch now runs. The "What to weigh" bullet about load in the background band describes a run that no longer happens. Re-dispatching the WebKit control at head, without the band, would show whether --workers 1 --load 4 still reproduces it, or whether the example needs other numbers.
The CI runner now runs `leaf-dev suite flake`'s copies and loops at normal priority, as the nightly does; the background band, and Races' `taskpolicy -b` advice, hold on a shared Mac. The `--workers 1 --load 4` example stays: at #6415's parent, at normal priority, it failed the nightly's assertion in 3 of 20 copies (run 44501699295), and six copies at once with no loops failed none of 18 (run 44501703758). > _This was written by Claude Code on behalf of max-sixty_
…'t reproduce it The dispatch paragraph read as routing every failure only `test-macos` shows to its runner, so this morning's worker went to CI's Mac first. On this Mac, `leaf-dev suite flake` at the base reproduced the live line reply failure at the nightly's line in 1 of 18 copies in 4 minutes, against 12 to 23 minutes a try on the runner (about 3 of them setup and teardown). The paragraph above already starves a test on this machine first; this keeps the dispatch for what that misses, and for a machine that isn't a Mac. Co-Authored-By: Claude <[email protected]>
A dispatch of
cinow takesflake, the arguments forleaf-dev suite flake. Given it, the dispatch skips the Linuxtestjob, andtest-macosrunsleaf-dev suite flakewith those arguments in place of the suite. The step's log ends with each test's count per outcome and every failure's message, and the artifact holds each copy's log and the pictures of its failing pages. With noflake, a dispatch runs what it ran before.leaf-dev suite flakegains the repeat count and the load as options:--copiesand--workers(how many copies, how many at once), which were the constants 18 and 6, and--load N, busy loops beside the copies that end with the command. On a CI runner the copies and loops run at normal priority, as the nightly does; on a shared Mac they keep the background band.gh workflow run ci --ref BRANCH -f flake="--workers 1 --load 4 'tests/x.py::test_y[firefox_browser]'"So a session reproduces a failure only the nightly macOS job shows without pushing a commit that edits this workflow, and without the maintainer's Mac. running-tend said such a failure waits on the maintainer "since no runner you can reach has macOS"; it now sends triage to the dispatch, and proves a macOS-only fix by the same dispatch failing on the base and passing on the fix, keeping the next scheduled run as the evidence only where no dispatch reproduces the failure. tests/AGENTS.md, Races, owns how to dispatch, and its sentence that Tend repairs
test-macosnow holds. Races sends a session on a Mac to the dispatch only for a failure its ownleaf-dev suite flakedoesn't reproduce: there, the live line reply failure reproduced in 1 of 18 copies in 4 minutes, where a try on the runner took 12 to 23.What to weigh
--loadloops (run), and in none of 18 run six at a time with no loops (run); the hand-written probe this replaces failed it in 3 of 20. Races' example uses--workers 1 --load 4, and--loadreplaces Races' advice to start busy loops by hand.leaf-dev suite flakeruns its copies and loops in macOS's background band so that a run on a shared Mac yields to that machine's other users. A CI runner has none (CIset), so there they run at normal priority, as the nightly does. In the band, a fresh runner's own startup work starved the first round of copies: the same eight copies, dispatched together, took 108 to 216 s per test and 22 minutes in all in the band (run), against 9 to 38 s and 5 minutes at normal priority (run). That first round produced failures the nightly never shows: a 120 s click whose page had taken it, andPage.gotoandPage.reloadtimeouts. In the band the WebKit test also failed an earlier reading in 14 of 20 copies, which the nightly never failed; at normal priority each failure was the nightly's own.main. A redcirun onmainof any event files a CI failure report throughtend-ci-failures, which starts triage, so Races and running-tend say to push the base to a branch of its own.TEND_BOT_TOKEN(write access); thetend-*workflows'actions: readapplies only to their ownGITHUB_TOKEN. That account dispatchedci15 times between Oct 28 and Nov 4, mostly on itsfix/issue-*branches.tend checkrequires a reviewer for aworkflow_dispatchwith inputs only where it reaches a credential environment, andcireaches none.Max asked for this; a fresh-context review read it, and its findings are folded in.
dev/tests/process/test_flake.pypasses, and fails if the loops aren't ended; pre-commit, actionlint included, passes.