Skip to content

Commit 96f288d

Browse files
authored
Merge pull request #2182 from lidge-jun/codex/windows-shard-truncation-and-budgets
fix(ci): stop the Windows leg from truncating and mismeasuring its own shards
2 parents 649912c + 88c4f15 commit 96f288d

4 files changed

Lines changed: 43 additions & 9 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,16 @@ jobs:
553553
# Sharded like the Linux legs. The single-leg run reached 30 minutes on a
554554
# green suite and was killed in cleanup; four shards put each leg inside the
555555
# same budget the Linux shards already hold.
556-
timeout-minutes: 15
556+
#
557+
# 15 was that Linux budget, and on this leg it truncated the evidence rather
558+
# than bounding a hang: shard 1/4 of run 32340498394 was CANCELLED at exactly
559+
# 15m12s while still executing tests, so its result was neither pass nor fail
560+
# and the composed-acceptance cases it carries could not be read at all. The
561+
# other shards finished in 14-15 minutes, which is the wrong side of the
562+
# margin. 25 leaves the outer bound in place — a wedged shard still dies —
563+
# while making a completed shard the normal outcome. The crash-retry below can
564+
# double a shard's work, and this ceiling has to cover that second attempt too.
565+
timeout-minutes: 25
557566
strategy:
558567
fail-fast: false
559568
matrix:

‎tests/ci-workflows.test.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,9 @@ describe("GitHub Actions hardening", () => {
101101
expect(ci.jobs?.test?.["timeout-minutes"]).toBe(15);
102102
expect(ci.jobs?.gates?.["timeout-minutes"]).toBe(15);
103103
expect(ci.jobs?.["platform-macos"]?.["timeout-minutes"]).toBe(30);
104-
expect(ci.jobs?.["platform-windows"]?.["timeout-minutes"]).toBe(15);
104+
// Higher than the Linux shards on purpose: at 15 the Windows leg cancelled a
105+
// shard mid-suite, which reports as neither pass nor fail (#2152).
106+
expect(ci.jobs?.["platform-windows"]?.["timeout-minutes"]).toBe(25);
105107
expect(ci.jobs?.["keyring-smoke"]?.["timeout-minutes"]).toBe(8);
106108
expect(ci.jobs?.["npm-global-smoke"]?.["timeout-minutes"]).toBe(8);
107109
expect(ci.jobs?.ci?.["timeout-minutes"]).toBe(5);

‎tests/claude-shell-hook.test.ts‎

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,21 @@ describe("Claude Code shell-hook reconciliation", () => {
8383
expect(readFileSync(zshrcPath, "utf8").match(/opencodex claude-env hook/g)).toHaveLength(1);
8484
});
8585

86-
test("does not treat a non-executable claude file as an installed CLI", () => {
87-
writeFileSync(join(binDir, "claude"), "#!/bin/sh\nexit 0\n", { mode: 0o644 });
86+
// Windows has no execute permission bit: `accessSync(path, X_OK)` succeeds for any
87+
// readable file, so a 0o644 fixture cannot express "present but not executable" there.
88+
// The case asserts a POSIX permission semantic, and skipping it on a platform that
89+
// cannot represent the precondition is honest; asserting it anyway measured the
90+
// fixture, not the product (#2152).
91+
test.skipIf(originalPlatform === "win32")(
92+
"does not treat a non-executable claude file as an installed CLI",
93+
() => {
94+
writeFileSync(join(binDir, "claude"), "#!/bin/sh\nexit 0\n", { mode: 0o644 });
8895

89-
expect(claudeCodeCliInstalled()).toBe(false);
90-
expect(reconcileShellHook(true)).toMatchObject({ changed: false, state: "absent" });
91-
expect(existsSync(zshrcPath)).toBe(false);
92-
});
96+
expect(claudeCodeCliInstalled()).toBe(false);
97+
expect(reconcileShellHook(true)).toMatchObject({ changed: false, state: "absent" });
98+
expect(existsSync(zshrcPath)).toBe(false);
99+
},
100+
);
93101

94102
test("removes the hook when system environment integration is inactive", () => {
95103
installClaudeCli();

‎tests/helpers/test-budget.ts‎

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,22 @@ export const STORE_BUDGET_MS = 30_000;
4444
* assertion (durable spill is the product contract), so the wait is intrinsic; the
4545
* orphan-cleanup cap test measured ~34s on windows-latest against Bun's 5s default.
4646
*/
47-
export const BULK_DURABLE_IO_BUDGET_MS = 90_000;
47+
export const BULK_DURABLE_IO_BUDGET_MS = bulkDurableIoBudgetMs();
48+
49+
/**
50+
* Windows needs a higher ceiling than the ~34s that sized this number, for the same
51+
* reason `watchdogMs` carries a higher floor there: the leg runs four Bun pools on one
52+
* runner, and every one of these writes is an individual fsync against a filesystem that
53+
* is slower under that contention to begin with. The orphan-cleanup cap case ran 100.6s
54+
* against the 90s budget on shard 4/4 (#2152) while doing exactly the work it claims —
55+
* 521 durable writes — so the number was measuring runner contention, not a hang.
56+
*
57+
* 180s stays a bound rather than an absence of one, and it is gated on Windows so no
58+
* other lane loses the shorter signal.
59+
*/
60+
function bulkDurableIoBudgetMs(): number {
61+
return process.platform === "win32" ? 180_000 : 90_000;
62+
}
4863

4964
/**
5065
* A deadline *inside* a test, for an await that would otherwise hang forever.

0 commit comments

Comments
 (0)