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
lastobelus added a commit that referenced this pull request Nov 15, 2026
## Problem

The carry-set ELI5 still described the August proposal, not the carry replay that has been the production path since 2026-09-05. The glossary and nightly workflow kept rollout-era lines: carry tooling "does not yet replace the nightly replay", files shared by several groups go to Incubator, a post-publication carry check that in fact runs only after historical-mode publications, and retirement criteria for historical replay. Refs #720.

## Change

- **ELI5** (`doc/design/2026-08-29__downstream-carry-set-eli5.html`): rewritten to describe carry replay as built. Each commit names its group with a `Carry-Group` trailer. A publication folds the PR squashes merged since the last one into six group commits on the old nightly, then replays only those six onto the new nightly with `rerere` off. It also covers the deferred-promotion exception to the tree check, conflict recovery, historical rollback, and what changed from the proposal.
- **Glossary**: describes the current carry set; the group order now includes Build & CI; a fix that edits lines a later group changed must move to that group; carry replay has no path ownership; the ELI5 link no longer says "proposal".
- **Nightly workflow**: the shadow check runs only after historical-mode publications; historical replay is an explicit rollback, not a pending retirement; `--reconstruct` only reproduces the bootstrap generation; the dashboard's replayed-commit count is normally 6.

## Scope

Documentation only, no behaviour change. Tracks #720 without closing it. The smoke gate description in the nightly workflow is left to another PR.

## Verification

- Checked each claim against `scripts/lastcode-carry-*.ts`, `scripts/lastcode-checkpoint.ts`, `scripts/lastcode-merge.ts`, the manifest and published tags. This covered contribution counts (2,256 in total, 1,015 in Incubator, 122 of 252 Upstream bugfixes without `Carry-Upstream`), `Fork-Commits-Rebased: 6` on every carry checkpoint tag, the first carry tag at 2026-09-05 18:23 PT, checkpoint 4449 folding #671–#688, checkpoint 3717's cross-base compile, and the trailers on #708 and #671.
- Corrected three errors in the rewrite before review: PR #708's groups, a claim that Incubator work can be retagged out, and the "carry patch" wording.
- `check:changed`: typecheck (41 packages) and the context-budget test pass, and formatting passes after `vp fmt`. The HTML tags are balanced.
- Quick CI deferred to GitHub because local capacity was busy, so there is no local receipt.

Local review: 3 rounds with GPT-6.1 Terra (xhigh) and Claude Opus 5.5 (xhigh), approved. Final-round nits were fixed afterwards.

Written with Claude Opus 5.5 in the Claude Code harness. Reviewed with GPT-6.1 Terra in Codex and Claude Opus 5.5.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Carry-Source-Ref: refs/lastcode/carry-sources/pr-725/a1e38bf562fb6faa8738a13d219d20f9925c657b
Carry-Source-Base: 99486a3
Carry-Source-Head: a1e38bf
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