Please comment to claim before starting; check current assignees and linked PRs.
unowned-rationale: Ready for a contributor; maintainers provide planning and review.
Context
Two independent e2e-engine (1/15) CI runs hit the 6-minute (360s) step ceiling on 2026-11-21 with 100% of executed tests passing:
- PR
#21766 (job 136782504763, defect-note MESSAGE:023cd3db): 57 passed (6.0m) (362s) -> killed at timeout-minutes: 6.
- PR
#21769 (job 136792762453): 38 passed (6.1m) (368s) -> killed at timeout-minutes: 6.
Across the five completed green 15-shard runs on 2026-11-21 (44883471766, 44883100147, 44880123498, 44878141569, 44876901023), shards 1/15 and 2/15 consistently ran in 305-340s while shards 5/15, 6/15, and 12/15 finished in 195-225s — a 110-125s systematic spread across shards that balancedShard() plans identically at 367-368s.
The Problem
#21493 rebuilt buildScripts/util/e2eEngineDurations.json at 243 files and switched durationOf()'s unmeasured-file fallback from the table's median to its 90th percentile (38.5s on today's table). That fallback works when 1-5 files are missing, because a single over-priced file leaves its own shard light and spreads (38.5s - actual) / 15 across the other 14 shards.
Since 2026-11-19, 44 new example/component E2E specs joined enginePaths() (287 executed specs vs 243 entries in e2eEngineDurations.json, verified via node --input-type=module importing enginePaths, balancedShard, and ENGINE_DURATIONS from buildScripts/util/e2eCiSelection.mjs at 7cd0d6618e / beb96c739a). When 44 unmeasured specs (~3 per shard) enter balancedShard()'s single greedy pass at p90 = 38.5s (ahead of 90% of measured files):
- Shard
1/15 starts with workstation/WorkstationFilmTourNL.spec.mjs (166.4s) and shard 2/15 starts with portal/ExamplesCatalogNL.spec.mjs (130.4s), while shards 5/15 and 6/15 start at 73.3s and 72.4s.
- Before shard
1/15 catches up in planned seconds, shards 5/15 and 6/15 absorb 4 unmeasured specs (154.0s of p90 budget for lightweight example specs) and shards 3..4, 7..15 absorb 3 (115.5s), while shard 1/15 receives 1 (38.5s) and shard 2/15 receives 2 (77.0s).
- The remaining ~219 measured specs (
< 38.5s) then equalize all 15 shards to 367-368s planned seconds — concentrating 328.6s of real measured work onto shard 1/15 (291.5s onto shard 2/15) vs 213.1-214.4s of real measured work on shards 5/15 and 6/15.
The Architectural Reality
Design authority: "the ceiling is six minutes of test time per shard … A shard nearing it gets its slow spec fixed first, and a sibling only when the runner budget has room" (.github/workflows/test.yml:465-469).
buildScripts/util/e2eCiSelection.mjs:221: ENGINE_DURATIONS loads buildScripts/util/e2eEngineDurations.json (243 entries vs 287 enginePaths() files).
buildScripts/util/e2eCiSelection.mjs:409-443: durationOf(durations) prices unmeasured files at known[Math.floor(known.length * .9)] (38.5s), and balancedShard({paths, shard, durations}) sorts paths in one pass by seconds(b) - seconds(a) || (a < b ? -1 : 1).
- Because unmeasured files carry identical unknown expected cost, letting heavy measured outliers (
166.4s, 130.4s) crowd unmeasured files onto other shards starves shard 1/15 of fallback headroom whenever a batch of specs lands between table rebuilds.
- Placing unmeasured files onto the lightest shards first (before known files are balanced longest-first on top) deals
44 unmeasured files evenly (3 on 14 shards, 2 on 1 shard), lowering the heaviest shard's known load on today's stale table from 328.6s to 291.4s (251.6-253.0s across the other 14 shards) while preserving #21493's single-missing-file behavior (1 missing file still plans at p90 and leaves its shard p90 lighter in known work).
The Fix
- Spread unmeasured specs evenly before balancing known specs in
balancedShard() (buildScripts/util/e2eCiSelection.mjs:430-443):
Sort unmeasured files (!(path in durations)) ahead of measured files in balancedShard() ((a in durations) - (b in durations) || seconds(b) - seconds(a) || (a < b ? -1 : 1)), and document why in balancedShard's JSDoc: unknown-cost files distribute floor(K/M)..ceil(K/M) per shard first so multi-spec waves cannot concentrate real measured load onto the shard holding the single longest spec.
- Rebuild
buildScripts/util/e2eEngineDurations.json from >= 5 recent completed full-matrix green runs:
Use gh run view <id> --repo neomjs/neo --log passed to node buildScripts/util/e2eCiSelection.mjs --engine-durations run1.log run2.log ... > buildScripts/util/e2eEngineDurations.json (candidate green 15-shard runs from 2026-11-21: 44883471766, 44883100147, 44880123498, 44878141569, 44876901023, or fresher completed full runs at pickup time) so every file in enginePaths() carries a measured per-run-max duration.
- Pin bulk-unmeasured balancing in
test/playwright/unit/buildScripts/util/E2eCiSelection.spec.mjs:
Add a deterministic unit arm (red on dev) with one heavy measured outlier (160s), smaller measured files (10-35s), and multiple unmeasured files (K >= 2 * shards), asserting that unmeasured files differ by at most 1 across shards and do not pile disproportionate known seconds onto shard 1.
Contract Ledger Matrix
| Target Surface |
Source of Authority |
Proposed Behavior |
Fallback |
Docs |
Evidence |
balancedShard({paths, shard, durations}) (buildScripts/util/e2eCiSelection.mjs:430) |
balancedShard & durationOf JSDoc (:402-429) |
Deals unmeasured files (!(path in durations), each priced at p90) across shards first, then balances measured files longest-first on top |
Empty durations ({}) still returns seconds: 0; 0 or 1 missing file matches existing p90 split |
balancedShard JSDoc in e2eCiSelection.mjs |
test/playwright/unit/buildScripts/util/E2eCiSelection.spec.mjs |
Decision Record impact: none.
Acceptance Criteria
Out of Scope
- Adding a 16th
e2e-engine shard (declined in #21493 under the 20-runner org pool budget).
- Raising
.github/workflows/test.yml:633's timeout-minutes: 6 ceiling (ruled out by .github/workflows/test.yml:465-469).
- Scheduled automatic table commits in CI (out of scope per
#21259, #21287, and #21493).
e2e-brain shard durations.
Avoided Traps
- Changing
durationOf() back to the median or mean: #21493 proved median under-plans single heavy new specs (11/17 exceeded the median) and puts the entire error onto one shard. Keeping p90 while dealing unmeasured files first preserves single-file headroom and eliminates multi-file starvation of shard 1/15.
- Rebuilding
e2eEngineDurations.json without fixing balancedShard(): Another wave of 30-40 Engine 14 / post-cut example specs would reproduce the exact 328.6s vs 213.1s real-work skew onto shard 1/15.
- Pooling 20-30 historical runs from older spec versions:
#21493 Avoided Traps showed stale per-file maxima from older spec revisions unbalance current splits; use 5-8 recent full-matrix runs.
Related
#21493 — introduced the p90 unmeasured-file fallback and 6m ceiling at 243 tier files.
#21287 — multi-run max engineDurations and 15-shard matrix.
#21259 — initial stale e2eEngineDurations.json diagnosis.
#21501 — extracted Generate the Docs class index out of the run step ceiling.
Live latest-open + closed sweep: checked latest 25 open issues (#21624-#21765) + open and closed searches (e2e shard, e2eEngineDurations, duration table, 6 minutes; read Out of Scope and Avoided Traps on closed #21493, #21287, #21259, and #21501) at 2026-11-21T09:08Z; 79 open issues (red), no open equivalent or owning CI-tier epic found.
A2A in-flight sweep: checked latest 30 messages (status: 'all') through 2026-11-21T09:08Z; only @neo-gemini-maryam's defect-note (MESSAGE:023cd3db), which this ticket promotes, touches e2e-engine (1/15) 360s timeouts.
MC sweep: query_raw_memories("e2e-engine shard timed out after 6 minutes all tests passed fallback duration table"), 8 results + ask_knowledge_base (type: 'ticket'), 5 refs (#21259, #21287, #21501, #20077, #21493), no prior exclusion on unmeasured-first shard ordering.
Own-assignment sweep: 5 open (#21765, #21707, #21676, #20987, #20671), none overlapping.
Agent OS structure map: n/a (buildScripts/util/ in neomjs/neo only).
Origin Session ID: 664ca229-4bbd-4e00-ae41-008707688181
Retrieval Hint: "bulk unmeasured e2e specs p90 fallback starves shard 1/15 balancedShard 6 minute ceiling"
Please comment to claim before starting; check current assignees and linked PRs.
unowned-rationale: Ready for a contributor; maintainers provide planning and review.
Context
Two independent
e2e-engine (1/15)CI runs hit the 6-minute (360s) step ceiling on 2026-11-21 with 100% of executed tests passing:#21766(job136782504763, defect-noteMESSAGE:023cd3db):57 passed (6.0m)(362s) -> killed attimeout-minutes: 6.#21769(job136792762453):38 passed (6.1m)(368s) -> killed attimeout-minutes: 6.Across the five completed green 15-shard runs on 2026-11-21 (
44883471766,44883100147,44880123498,44878141569,44876901023), shards1/15and2/15consistently ran in305-340swhile shards5/15,6/15, and12/15finished in195-225s— a110-125ssystematic spread across shards thatbalancedShard()plans identically at367-368s.The Problem
#21493rebuiltbuildScripts/util/e2eEngineDurations.jsonat243files and switcheddurationOf()'s unmeasured-file fallback from the table's median to its 90th percentile (38.5son today's table). That fallback works when1-5files are missing, because a single over-priced file leaves its own shard light and spreads(38.5s - actual) / 15across the other 14 shards.Since 2026-11-19,
44new example/component E2E specs joinedenginePaths()(287executed specs vs243entries ine2eEngineDurations.json, verified vianode --input-type=moduleimportingenginePaths,balancedShard, andENGINE_DURATIONSfrombuildScripts/util/e2eCiSelection.mjsat7cd0d6618e/beb96c739a). When44unmeasured specs (~3per shard) enterbalancedShard()'s single greedy pass atp90 = 38.5s(ahead of 90% of measured files):1/15starts withworkstation/WorkstationFilmTourNL.spec.mjs(166.4s) and shard2/15starts withportal/ExamplesCatalogNL.spec.mjs(130.4s), while shards5/15and6/15start at73.3sand72.4s.1/15catches up in planned seconds, shards5/15and6/15absorb 4 unmeasured specs (154.0sofp90budget for lightweight example specs) and shards3..4, 7..15absorb 3 (115.5s), while shard1/15receives 1 (38.5s) and shard2/15receives 2 (77.0s).< 38.5s) then equalize all 15 shards to367-368splanned seconds — concentrating328.6sof real measured work onto shard1/15(291.5sonto shard2/15) vs213.1-214.4sof real measured work on shards5/15and6/15.The Architectural Reality
Design authority:
"the ceiling is six minutes of test time per shard … A shard nearing it gets its slow spec fixed first, and a sibling only when the runner budget has room"(.github/workflows/test.yml:465-469).buildScripts/util/e2eCiSelection.mjs:221:ENGINE_DURATIONSloadsbuildScripts/util/e2eEngineDurations.json(243entries vs287enginePaths()files).buildScripts/util/e2eCiSelection.mjs:409-443:durationOf(durations)prices unmeasured files atknown[Math.floor(known.length * .9)](38.5s), andbalancedShard({paths, shard, durations})sortspathsin one pass byseconds(b) - seconds(a) || (a < b ? -1 : 1).166.4s,130.4s) crowd unmeasured files onto other shards starves shard1/15of fallback headroom whenever a batch of specs lands between table rebuilds.44unmeasured files evenly (3on 14 shards,2on 1 shard), lowering the heaviest shard's known load on today's stale table from328.6sto291.4s(251.6-253.0sacross the other 14 shards) while preserving#21493's single-missing-file behavior (1missing file still plans atp90and leaves its shardp90lighter in known work).The Fix
balancedShard()(buildScripts/util/e2eCiSelection.mjs:430-443): Sort unmeasured files (!(path in durations)) ahead of measured files inbalancedShard()((a in durations) - (b in durations) || seconds(b) - seconds(a) || (a < b ? -1 : 1)), and document why inbalancedShard's JSDoc: unknown-cost files distributefloor(K/M)..ceil(K/M)per shard first so multi-spec waves cannot concentrate real measured load onto the shard holding the single longest spec.buildScripts/util/e2eEngineDurations.jsonfrom >= 5 recent completed full-matrix green runs: Usegh run view <id> --repo neomjs/neo --logpassed tonode buildScripts/util/e2eCiSelection.mjs --engine-durations run1.log run2.log ... > buildScripts/util/e2eEngineDurations.json(candidate green 15-shard runs from 2026-11-21:44883471766,44883100147,44880123498,44878141569,44876901023, or fresher completed full runs at pickup time) so every file inenginePaths()carries a measured per-run-max duration.test/playwright/unit/buildScripts/util/E2eCiSelection.spec.mjs: Add a deterministic unit arm (red ondev) with one heavy measured outlier (160s), smaller measured files (10-35s), and multiple unmeasured files (K >= 2 * shards), asserting that unmeasured files differ by at most1across shards and do not pile disproportionate known seconds onto shard1.Contract Ledger Matrix
balancedShard({paths, shard, durations})(buildScripts/util/e2eCiSelection.mjs:430)balancedShard&durationOfJSDoc (:402-429)!(path in durations), each priced atp90) across shards first, then balances measured files longest-first on topdurations({}) still returnsseconds: 0; 0 or 1 missing file matches existingp90splitbalancedShardJSDoc ine2eCiSelection.mjstest/playwright/unit/buildScripts/util/E2eCiSelection.spec.mjsDecision Record impact: none.
Acceptance Criteria
balancedShard()deals unmeasured files (!(path in durations)) before measured files so unmeasured file counts per shard differ by at most1, pinned by a new unit test intest/playwright/unit/buildScripts/util/E2eCiSelection.spec.mjsthat fails ondevand passes on the branch (npx playwright test --config test/playwright/playwright.config.unit.mjs test/playwright/unit/buildScripts/util/E2eCiSelection.spec.mjs).buildScripts/util/e2eEngineDurations.jsonholds a measured duration for every currentenginePaths()file, rebuilt via--engine-durationsfrom at least 5 completed full-matrix runs named in the PR body.213.1-328.6s) and after (251.6-291.4s) thebalancedShard()ordering fix.Out of Scope
e2e-engineshard (declined in#21493under the 20-runner org pool budget)..github/workflows/test.yml:633'stimeout-minutes: 6ceiling (ruled out by.github/workflows/test.yml:465-469).#21259,#21287, and#21493).e2e-brainshard durations.Avoided Traps
durationOf()back to the median or mean:#21493proved median under-plans single heavy new specs (11/17exceeded the median) and puts the entire error onto one shard. Keepingp90while dealing unmeasured files first preserves single-file headroom and eliminates multi-file starvation of shard1/15.e2eEngineDurations.jsonwithout fixingbalancedShard(): Another wave of 30-40 Engine 14 / post-cut example specs would reproduce the exact328.6s vs 213.1sreal-work skew onto shard1/15.#21493Avoided Traps showed stale per-file maxima from older spec revisions unbalance current splits; use5-8recent full-matrix runs.Related
#21493— introduced thep90unmeasured-file fallback and6mceiling at243tier files.#21287— multi-run maxengineDurationsand15-shard matrix.#21259— initial stalee2eEngineDurations.jsondiagnosis.#21501— extractedGenerate the Docs class indexout of the run step ceiling.Live latest-open + closed sweep: checked latest 25 open issues (
#21624-#21765) + open and closed searches (e2e shard,e2eEngineDurations,duration table,6 minutes; readOut of ScopeandAvoided Trapson closed#21493,#21287,#21259, and#21501) at 2026-11-21T09:08Z;79open issues (red), no open equivalent or owning CI-tier epic found. A2A in-flight sweep: checked latest 30 messages (status: 'all') through2026-11-21T09:08Z; only@neo-gemini-maryam'sdefect-note(MESSAGE:023cd3db), which this ticket promotes, touchese2e-engine (1/15)360stimeouts. MC sweep:query_raw_memories("e2e-engine shard timed out after 6 minutes all tests passed fallback duration table"), 8 results +ask_knowledge_base(type: 'ticket'), 5 refs (#21259,#21287,#21501,#20077,#21493), no prior exclusion on unmeasured-first shard ordering. Own-assignment sweep: 5 open (#21765,#21707,#21676,#20987,#20671), none overlapping. Agent OS structure map: n/a (buildScripts/util/inneomjs/neoonly).Origin Session ID: 664ca229-4bbd-4e00-ae41-008707688181 Retrieval Hint: "bulk unmeasured e2e specs p90 fallback starves shard 1/15 balancedShard 6 minute ceiling"