Skip to content

test(console): make the utc-offset log timestamp test fast again - #2841

Merged
freeqaz merged 3 commits into
mainfrom
lows-1018g
Oct 18, 2026
Merged

freeqaz merged 3 commits into
mainfrom
lows-1018g

Conversation

@freeqaz

@freeqaz freeqaz commented Oct 18, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

#2819 grew "log timestamps with their UTC offset stay on one line" (tests/browser/console-agent-logs.test.mjs) from 5 to 10 locale cases and to seven browser round trips per viewport width (22 widths per case). Each case also launched its own Chromium and signed in again. In CI the test went from about 4.4 s to 11.0 s, which moved the checks-browser lane p50 from 75 s to 82 s. The file's file-durations.json row (74.0 s) was stale again against a p50 of 82.3 s.

Change

Test-only. The locales, time zones, widths and assertions are the same as before.

  • One Chromium: the cases share one browser through the existing fileBrowser() helper. Each case still gets its own context, with its own locale and time zone.
  • One sign-in: the first case signs in, and later contexts start with its storage state (the session cookie).
  • One read per width: a single evaluate per width returns everything the assertions need: each cell's line count and its left and right fit, the column starts for .log-time, .log-level and .log-origin, each time cell's width and font size, overflow, and the message box. The assertions run on that result as before.
  • One Agent per case: runtime-log reads are rate limited per principal and Agent (burst 10, then 2 a second). The faster loop hit a 429 on its 9th case, so each case reads its own Agent's logs.
  • Duration row: file-durations.json's console-agent-logs row goes from 74.0 s to 78.2 s. That is the median of the five green main runs ending at bef197b (82.3 s, the method test(ci): refresh three stale file duration rows #2815 used), less the 4.1 s this PR took off the test on its own CI. The source note says so.

Verification

  • Timing: the test alone, 20 runs each, pinned to 2 CPUs (taskset -c 10,11) with the Korean font used for fix(console): size the log time column to the locale's widest timestamp #2819. Before: p50 9.40 s (min 9.16, max 9.93). After: p50 5.07 s (min 4.98, max 5.19). 20/20 passed, and 20/20 again on the final test head (p50 5.11 s).
  • Mutants: I applied these to fitLogTimeColumn and ran both the old and the new test against each.
    • Not setting data-long-time: both fail the same way ("message 191px wide beside the time, ko-KR Asia/Seoul at 1300px").
    • Sampling only October and December: both fail the same way ("31/07/2026, 12:59:59 pm GMT+10:30 inside its cell, en-AU Australia/Lord_Howe at 1440px").
    • Dropping the 4 px slack, dropping --log-time-width, or sampling one hour: both pass, so the new test is no weaker than the old one on these.
  • Whole file: 49/49 passed at 2 CPUs.
  • CI: on this PR's first run (39124660181, Console Browser), the test took 6.88 s, against a median of 10.96 s over those five main runs. The file took 79.6 s.
  • Suite audit: node scripts/ci/run-tests.mjs audit reports no issues.
  • Formatting and lint: prettier and eslint pass on the file.

Risks

Low. This is test-only. The per-width checks now read one synchronous layout snapshot instead of seven back-to-back reads. That is as strict as the old first read, which was already the line-and-fit check.

The UTC-offset timestamp test grew from 5 to 10 locale cases in #2819 and
read the pane with seven browser round trips per width (220 widths), each
case launching its own Chromium and signing in again: 4.4 s became 11.0 s
in CI. It now shares one Chromium across the cases, reuses the first
case's session, reads all per-width measurements in one evaluate, and gives
each case its own Agent so the per-principal runtime-log rate limit (burst
10, 2/s) does not throttle the faster cases. Same locales, widths and
assertions. Local p50 9.40 s -> 5.07 s (20 runs each, 2 CPUs).
… cell is absent

Review nit: a missing row failed with a bare TypeError from the in-page read.
@freeqaz
freeqaz requested a review from a team as a code owner October 18, 2026 11:47
@clawsweeper

clawsweeper Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

Median of the five green main runs ending at bef197b (82.3 s), less the
4.1 s this branch took off the UTC-offset test on its own CI (10.96 s main
median to 6.88 s): 78.2 s.
@freeqaz
freeqaz temporarily deployed to integration-qa-pr October 18, 2026 11:51 — with GitHub Actions Inactive
@freeqaz
freeqaz temporarily deployed to integration-qa-pr October 18, 2026 11:51 — with GitHub Actions Inactive
@clawsweeper clawsweeper Bot added P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 18, 2026
@freeqaz
freeqaz merged commit 387e5b9 into main Oct 18, 2026
46 of 47 checks passed
@freeqaz
freeqaz deleted the lows-1018g branch October 18, 2026 12:04
@clawsweeper

clawsweeper Bot commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR shares Chromium and authentication across timestamp cases, batches layout measurements, and updates the CI duration estimate.

Example: Run the timestamp layout test across 10 locale/time-zone cases and 22 viewport widths.

  • Before: The test launches 10 browsers and performs 1,540 per-width layout evaluations.
  • After: The test shares one browser and performs 220 layout evaluations while retaining the same assertions.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Focused and apparently correct, with exact-head harness validation; timing and mutation results remain author-reported rather than independently inspected raw output.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored test-only change is outside the ordinary production-proof gate; exact-head browser CI passed, and the author reports repeated timing and mutation comparisons. Inspected screenshots belong to the earlier layout fix and do not prove this optimization.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
User problem: Contributors wait longer for console browser feedback after the timestamp coverage expansion.
Reason: The maintainer-authored direction is established, and the focused optimization preserves coverage without introducing product options or contracts.

Merge readiness

✅ Ready for maintainer review

Keep open: this PR is a useful, focused test optimization with no actionable findings; repository policy reserves closure for maintainer triage.

Priority: P3
Reviewed head: 498371b017b6493556ac0344b1972f77914cdcaf

Before merge

None.

Findings

None.

Agent review details

How this fits together

The browser suite renders the production console against the controller application with an in-memory Compute Driver, reads timestamp geometry, and reports assertions to CI; the duration table controls shared-file scheduling.

flowchart TD
  A[CI browser lane] --> B[Timestamp test]
  B --> C[Shared Chromium]
  C --> D[Isolated locale contexts]
  E[Controller fixture] --> F[Console log view]
  D --> F
  F --> G[Layout assertions]
Loading

Technical review

Best possible solution:

Retain the existing browser helper and complete timestamp matrix while collecting each width’s geometry in one synchronous snapshot.

Do we have a high-confidence way to reproduce the issue?

Source confirms repeated browser launches, sign-ins, and seven layout evaluations per width on main; the author reports repeated timing comparisons, but no tests were run during this read-only review.

Is this the best way to solve the issue?

The change addresses test overhead through existing lifecycle helpers, preserves independent browser contexts and assertions, and avoids changing application behavior.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 2ed2ce1f0136.

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Free Wortley: Raw commit e9bc5ad adds tests/browser/console-agent-logs.test.mjs:444 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: e9bc5adef3c2; files: tests/browser/console-agent-logs.test.mjs)

Review metrics

Metric Value Why it matters
Per-width browser evaluations 1,540 → 220 Seven evaluations become one across the unchanged 10-by-22 matrix.
Diff scope Production +0/-0; browser test +81/-43; scheduling metadata +2/-2 Growth batches the existing observations without adding production machinery or test cases.

Labels

Label changes:

  • add P3: This improves contributor feedback speed without changing product behavior.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P3: This improves contributor feedback speed without changing product behavior.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 18, 2026, 8:03 AM ET / 12:03 UTC.

This branch was previously deployed

1 inactive deployment
integration-qa-pr — 498371b0 Deployed Oct 18, 2026 by freeqaz via QA advisory (compose) #2193
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant