Skip to content

fix(tests): fix flaky thread-link popup and timeline focus tests - #688

Merged
lastobelus merged 2 commits into
lastcode/mainfrom
lastcode/fix-thread-link-and-timeline-flaky-tests
Nov 10, 2026
Merged

lastobelus merged 2 commits into
lastcode/mainfrom
lastcode/fix-thread-link-and-timeline-flaky-tests

Conversation

@lastobelus

@lastobelus lastobelus commented Nov 10, 2026 •

Copy link
Copy Markdown
Owner

Two tests fail intermittently in CI. This fixes both at the cause. There is no quarantine, longer timeout, retry, sleep or frame wait. Only two test files change and production behavior is unchanged.

🔗 ThreadLinkNavigation.test.ts (popup click stalls)

  • Symptom: the #popup click stalls after the button is visible, enabled and stable (CI #42732216310, #42725878203).
  • Cause: the fixture's Target.targetCreated handler closed the uninitialized custom-protocol target immediately. That happened in the middle of the source window's window.open input dispatch, so the click never finished.
  • Fix: the handler records the target ID, and the test closes the target only after locator.click completes.
  • Coverage kept: the real uncommitted custom-protocol popup and hosted new-window cases. A controlled handler case delivers an already-closed popup and asserts its closed state at interception.

⌨️ MessagesTimeline.browser.test.tsx (focus/keyboard test)

  • Cause 1: the 1200px fixture is taller than the browser's visible area, so it focused an offscreen composer.
  • Cause 2: the fixed {x:100,y:1} click could land on virtual row content or controls instead of blank viewport.
  • Cause 3: scrollTop > 0 can happen before the rows are interactive.
  • Fix:
    • The fixture height is now min(600px, 100vh).
    • The viewport gets 32px of right padding.
    • The test waits for the final row to have pointerEvents: auto.
    • It clicks the padding, then asserts the viewport has focus before any keyboard assertion.
  • Coverage kept: every F6, Home, ArrowUp, ArrowDown and no-focus-theft assertion.

📊 Evidence

Repeat runs. I used a temporary serial repeat harness, removed before commit.

Test Before After
Thread-link popup 7 failures / 10 runs 0 / 10
Timeline 1 failure / 30 runs 0 / 30

This is repeated-run evidence, not a deterministic forced-order reproduction.

CI history. Of 100 recent CI runs, 13 failed (27 succeeded, 52 were cancelled, 7 skipped and 1 was still running).

  • Popup stall: 2 of the 13.
  • Timeline: 5 of the 13, including PR run 42725184788 and main pushes 42663496462, 42676775246, 42725878203 and 42736569165.
  • These are counts of CI runs, not per-test failure rates. Caches and earlier failures can skip tests.

Checks.

⚠️ Not changed

  • ConnectionTransientError environment-discovery warnings still appear in passing focused runs. I made no connection-code change because nothing here justified one.
  • The ResizeObserver error in the supplied CI output belongs to the following rendered-height test, which passed.

Both test files belong to Incubator. Each of the two source commits has Carry-Group: incubator.

Local review: 2 rounds with gpt-6.1-terra (xhigh) and Claude Opus 5.5 (high), approved.

Implemented by GPT-6.1 Sol (xhigh) in the Codex harness.

Close custom-protocol popup targets only after source input dispatch finishes. Keep keyboard focus coverage inside the visible browser area, wait for interactive rows, and click explicit viewport padding.

Carry-Group: incubator

Carry-Observation: Feature-specific Browser thread-link and conversation focus regressions stay with their Incubator features.
@lastobelus lastobelus changed the title fix(tests): remove thread-link and timeline races fix(tests): fix flaky thread-link popup and timeline focus tests Nov 10, 2026
Deliver an uncommitted closed popup through the controlled event fixture and assert its closed state when interception receives it.

Carry-Group: incubator
@lastobelus
lastobelus marked this pull request as ready for review November 10, 2026 02:14
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-10T02:16:29.345901Z 75a1f86 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: 75a1f862ca

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@lastobelus
lastobelus merged commit fddd279 into lastcode/main Nov 10, 2026
31 checks passed
@lastobelus
lastobelus deleted the lastcode/fix-thread-link-and-timeline-flaky-tests branch November 10, 2026 02:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant