oficina / equipo Public

Mac slice F task 17: the CSP browser test clicks only once painted

TestBrowserGitHubManifestCSP failed every run at mac-slice-f (4 of 4,
context deadline exceeded) and passed at 8bd40ed1. Bisect: first bad
e4730005 (mac-placement-wait, merged here), which changes nothing on
that page; adding a request logger to the test makes 8bd40ed1 fail the
same way. Cause: chromedp clicks at coordinates, and the click came
before the manifest page was painted (elementsFromPoint at the button
returned only <html>), so the form to GitHub was never sent. The test
now waits until the button is the element under its centre. Passes 3
of 3 here and at 8bd40ed1.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by paul@keymail.dev c69bab8a7b9254f8acc5ce9a8db488f01be2e5c1 parent 5e7b19a
1 file changed, +7 −1
  • internal/equipotest/github_browser_test.go +7 −1
diff --git a/internal/equipotest/github_browser_test.go b/internal/equipotest/github_browser_test.go
index 359552d0..db3ca421 100644
--- a/internal/equipotest/github_browser_test.go
+++ b/internal/equipotest/github_browser_test.go
@@ -23,6 +23,12 @@ import (
"github.com/chromedp/chromedp"
)
+// manifestButtonClickable waits until the manifest page's button is the
+// element under its own centre. chromedp clicks at coordinates, and a
+// click before the page is first painted lands on nothing: the form is
+// never sent (seen 2026-11-29 on docs-t1, every run on mac-slice-f).
+const manifestButtonClickable = `(()=>{const b=document.querySelector('form[action^="https://github.com/"] button');if(!b)return false;const r=b.getBoundingClientRect();return document.elementFromPoint(r.x+r.width/2,r.y+r.height/2)===b})()`
+
func TestBrowserGitHubManifestCSP(t *testing.T) {
const origin = "https://equipo.example.test"
d, logger := foundationDB(t)
@@ -91,7 +97,7 @@ func TestBrowserGitHubManifestCSP(t *testing.T) {
run(chromedp.Func(func(ctx context.Context, target *chromedp.Target) error {
_, e := chromedp.Evaluate[any](fmt.Sprintf(`document.querySelector('#github-account').value=%q`, g.Login))(ctx, target)
return e
- }), browsertest.Click("#github-start button"), browsertest.Wait(`!!document.querySelector('input[name="manifest"]')`), browsertest.Click(`form[action^="https://github.com/"] button`), browsertest.Wait(`location.origin==="https://equipo.example.test" && location.pathname==="/conversation/settings/github" && location.search==="" && !!document.querySelector('form[action="/github/connect/confirm"]')`))
+ }), browsertest.Click("#github-start button"), browsertest.Wait(manifestButtonClickable), browsertest.Click(`form[action^="https://github.com/"] button`), browsertest.Wait(`location.origin==="https://equipo.example.test" && location.pathname==="/conversation/settings/github" && location.search==="" && !!document.querySelector('form[action="/github/connect/confirm"]')`))
if posts.Load() != 1 {
t.Fatal("manifest POST did not reach GitHub")
}