Press again for the tab the driver lost, not the one Chromium never made - #40
Conversation
# Conflicts: # tests/test_render.py
leaf-agent
left a comment
There was a problem hiding this comment.
Reviewing my own PR, so this is a COMMENT rather than a verdict.
The diagnosis holds. A fact the driver drops on its way out of the browser is not a page state a route can arrange, the reading behind it is the browser's own record rather than an inference, and all three sites that wait on a browser-opened tab now go through one helper. Two things in that helper don't yet match what its docstring promises, both inline: the except can't distinguish the tab wait's timeout from one the press raised itself, and the rate the docstring states isn't the rate the PR body measured.
One thing worth a line in the docstring rather than machinery: a lost press leaves a real, loaded Chromium tab that nothing closes, so test_a_message_reference_travels_or_says_it_cant's tab.close() now accounts only for the try that was reported. No assertion at the three sites reads a tab or a leaf count, so nothing false passes — but it is the standing cost of the repeat, and the leaked tab goes on polling its server until context teardown.
lint is green. test was still running when the poll cap expired, so the 23 browser tests this change touches are unverified from here rather than green.
|
This landed again on main: run 32907461091 on That is the second occurrence on main inside 24 hours (32790759750 at 2026-08-24 23:45Z, this one at 2026-08-25 22:42Z), with all 23 The branch is still good to merge: 3 ahead of main and 11 behind, no conflict ( |
|
Third occurrence on main, and the first since the note above: run 32920132953 on The rate has moved the wrong way. Counting Branch is still clean to merge: 3 ahead, 21 behind, |
|
Fourth occurrence, 70 minutes after the third: run 32924462601 on The rate is the only new fact. Counting completed Nothing changed on this branch: still green on its last run, |
|
Fifth occurrence: run 32946946913 on The one new fact is that the failing site moved without moving: the wait is now Rate since the first occurrence at 2026-08-24 23:45Z: 5 failures in 50 completed |
|
@tend-agent we have to fix the titles; how is this a reasonable title for the issue. it needs to be understandable for a normal person to have some idea of the problem! |
|
Fair, and it's the merge commit on What produced them: the repo's own commit titles are imperative and elliptical, and they work because their subjects — a focus ring, a key line, an ask — are things a reader of this repo already knows. I was matching that register on machinery nobody has met yet, which turns it into a riddle instead of a summary. #45 writes the rule into Applied to the one open PR already — #44 is now "Replace a 250ms sleep in the work-line test with a real control". This one and #42 are merged, so those two stay as they are. |
|
One thing the overlay in #45 can't see from inside this repo: the bundled rule already exists and never arrived here. It needed sharpening too, and #45's before/after pairs are the right instinct about why: the bundled rule stated the goal ("plain, literal language") without naming the shapes that break it, so a title written as a figure passes its own check. max-sixty/tend#1060 adds a reader test — someone who has not read the diff can say what was wrong — a bad → good rewrite using this PR's title as the example, and extends the rule to issue titles rather than PR titles alone. |
Problem
Run 32790759750 failed
test_a_message_reference_travels_or_says_it_cant—TimeoutError: Timeout 30000ms exceeded while waiting for event "page"— at the ⌃-click that opens a message reference in its own tab. Chromium opened that tab. Playwright never handed it over.Reproduced locally at 3–4 misses in 60 presses on a loaded machine, and read from the browser's own record rather than inferred. On a miss the click reaches the anchor and nothing refuses it, and
Target.getTargetsholds a second page target in the same browser context — attached, loaded, titled, sitting at the href — whilecontext.pagesstill holds one. The targets pile up press after press and Playwright reports none of them, soexpect_pagespends its whole timeout on a tab that already exists.Solution
opened_tab(page, press)makes the press again when the wait comes back empty: three tries at 10s each. A driver that loses the handle is not a page statepage.routecan arrange, and there is no second channel to reach an unreported tab through, so re-pressing is the only instrument left — the same class of repair as #26'sCutOff, and stated as such in the helper's docstring and intests/CLAUDE.mdbeside the rule it reads against.The retry cannot green a runtime that stopped leaving a real href for the platform to act on: that opens no tab for any of the tries. Bug-back, refusing only the modified press in
leaf.js's panel handler so the plain jump still works — the test fails atopened_tabin 31.9s with the same missing-tab wait.All three sites that wait on a browser-opened tab go through it. The chord is not what decides the loss: over 60 presses each, ⌃-click lost 3, ⌃⇧-click 10, ⇧-click 1.
Testing
-n0 --run-nightly): 23 passed.pre-commitclean on both changed files.The reading that named it
Three misses out of 60 presses on one page.
clicksis what the page saw of the press;targetsisTarget.getTargetson a browser CDP session, taken 1.5s after the wait gave up:Both targets carry the same
browserContextId, andbrowser.contextsstays at one context holding one page. By the third miss there are four such targets andcontext.pagesis still one: the tab is never reported, not reported late.The press is not what fails.
ctrl: Truewithprevented: Falsesays the anchor took a real modified press and the runtime let it through;detail: 1rules out the press being folded into a double-click.Automated fix for failed run