Skip to content

Commit c1c4edf

Browse files
killaguclaude
andcommitted
fix(ci): set HOME on windows; bump rest shards 6β†’8 for ubuntu margin
- Windows whole-suite failed deterministically on the lone egg_loader.test.ts > getHomedir test: newer windows-latest images leave %HOME% unset, so getHomedir() returns os.homedir() (C:\Users\runneradmin) while the test asserts it equals process.env.HOME (undefined). Older runner images set HOME=USERPROFILE, which is why next was green. Restore that by exporting HOME=%USERPROFILE% on windows test jobs β€” no test change. - Bump rest shards 6β†’8 so the two marginal ubuntu shards (rest-1 67s, rest-4 61s) drop under 60s with headroom. 24 ubuntu shard groups total. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 36c8db2 commit c1c4edf

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

β€Ž.github/workflows/ci.ymlβ€Ž

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ jobs:
103103
- rest-4
104104
- rest-5
105105
- rest-6
106+
- rest-7
107+
- rest-8
106108
include:
107109
# macOS/Windows runners have very low concurrency (~5 macOS slots), so
108110
# fanning out 22 shards Γ— 2 nodes would queue ~9 batches and blow up
@@ -229,6 +231,16 @@ jobs:
229231
# directly, bypassing the npm `preci` lifecycle, so do it explicitly.
230232
run: ut run pretest
231233

234+
- name: Set HOME on Windows
235+
# Newer windows-latest runner images leave %HOME% unset, while
236+
# @eggjs/core's getHomedir() falls back to os.homedir()
237+
# (C:\Users\runneradmin). egg_loader.test.ts asserts
238+
# getHomedir() === process.env.HOME, so align HOME with USERPROFILE the
239+
# way older runner images did. Unix runners already export HOME.
240+
if: ${{ matrix.os == 'windows-latest' }}
241+
shell: pwsh
242+
run: echo "HOME=$env:USERPROFILE" >> $env:GITHUB_ENV
243+
232244
- name: Run tests (shard ${{ matrix.shard }})
233245
run: node scripts/run-shard.js ${{ matrix.shard }} -- --coverage
234246

β€Žscripts/run-shard.jsβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ const HEAVY_DIRS = new Set(Object.values(HEAVY_SHARDS).map((v) => v.dir));
7070
// largest-first bin-packing keeps the heaviest leftover dirs (onerror,
7171
// logrotator, watcher, tegg/plugin/tegg) on separate shards so no single shard
7272
// dominates. Unlisted dirs default to a small weight.
73-
const REST_SHARD_COUNT = 6;
73+
const REST_SHARD_COUNT = 8;
7474
const REST_DIR_WEIGHTS = {
7575
'plugins/watcher': 9.7,
7676
'packages/core': 7.6,

0 commit comments

Comments
Β (0)