Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

ci(native-locks): bound every Windows probe step; the job limit is those bounds plus runner setup

garrytan7c9be4ef7859
diff --git a/.github/workflows/native-locks.yml b/.github/workflows/native-locks.yml
index 63cbb9b9ee..ee5b2b9c28 100644
--- a/.github/workflows/native-locks.yml
+++ b/.github/workflows/native-locks.yml
@@ -180,7 +180,11 @@ jobs:
# Named exception: PR scope reduction, covered by scope=full runs (docs/TESTING.md#event-parity).
if: ${{ inputs.scope != 'smoke' }}
runs-on: ${{ matrix.runner }}
- timeout-minutes: 5
+ # Every step carries its own bound (p99.9 over 541 windows-11-arm jobs: checkout 45 s, setup-bun 21 s,
+ # install 59 s, verify 2 s, probe 43 s), so a stalled step fails by name. The job limit is those bounds plus
+ # 5 minutes for runner setup, which GitHub counts against the job ("Set up job" p95 2 s, p99.9 16 s; one ARM
+ # job spent 218 s there and the old 5-minute limit cancelled its passed probe).
+ timeout-minutes: 22
strategy:
fail-fast: false
matrix:
@@ -190,14 +194,18 @@ jobs:
exclude: ${{ fromJSON(inputs.scope == 'full' && '[]' || '[{"bun":"1.4.0"}]') }}
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
+ timeout-minutes: 2
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6
+ timeout-minutes: 2
with:
bun-version: ${{ matrix.bun }}
- name: Install dependencies (bounded, retried once)
timeout-minutes: 8
run: bun scripts/ci-bun-install.ts --frozen-lockfile --ignore-scripts
- run: bun scripts/native/verify.ts
+ timeout-minutes: 1
- name: Compare native hidden-window launch behavior
+ timeout-minutes: 4
shell: bash
env:
GBRAIN_CI_DISABLE_TEST_ENV_FILE: '1'
@@ -211,7 +219,8 @@ jobs:
# Named exception: PR scope reduction, covered by scope=full runs (docs/TESTING.md#event-parity).
if: ${{ inputs.scope != 'smoke' }}
runs-on: ${{ matrix.runner }}
- timeout-minutes: 5
+ # As above (probe p99.9 97 s over 267 windows-11-arm jobs; two tests at 180 s each): step bounds plus 5 minutes of setup.
+ timeout-minutes: 25
strategy:
fail-fast: false
matrix:
@@ -221,14 +230,18 @@ jobs:
exclude: ${{ fromJSON(inputs.scope == 'full' && '[]' || '[{"bun":"1.4.0"}]') }}
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
+ timeout-minutes: 2
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6
+ timeout-minutes: 2
with:
bun-version: ${{ matrix.bun }}
- name: Install dependencies (bounded, retried once)
timeout-minutes: 8
run: bun scripts/ci-bun-install.ts --frozen-lockfile --ignore-scripts
- run: bun scripts/native/verify.ts
+ timeout-minutes: 1
- name: Compare cmdlet and direct dotnet ACL programs
+ timeout-minutes: 7
shell: bash
env:
GBRAIN_CI_DISABLE_TEST_ENV_FILE: '1'
diff --git a/test/scripts/data-safety-native-workflow.test.ts b/test/scripts/data-safety-native-workflow.test.ts
index 355503ce5f..5e0a81b3e5 100644
--- a/test/scripts/data-safety-native-workflow.test.ts
+++ b/test/scripts/data-safety-native-workflow.test.ts
@@ -7,6 +7,8 @@ import { load } from 'js-yaml';
type Step = {
name?: string;
+ uses?: string;
+ 'timeout-minutes'?: number;
if?: string;
shell?: string;
run?: string;
@@ -35,7 +37,6 @@ describe('data-safety native CI coverage', () => {
test('the opt-in console diagnostic has an isolated Windows matrix without filtering the acceptance suites', () => {
const job = workflow.jobs['windows-backup-console'];
expect(job['runs-on']).toBe('${{ matrix.runner }}');
- expect(job['timeout-minutes']).toBe(5);
expect(job.strategy['fail-fast']).toBe(false);
expect(job.strategy.matrix.runner).toEqual(['windows-2022', 'windows-11-arm']);
expect(job.strategy.matrix.bun).toEqual(['1.4.0', '1.4.4']);
@@ -70,7 +71,6 @@ describe('data-safety native CI coverage', () => {
test('the direct dotnet program comparison has its own four-cell opt-in Windows job', () => {
const job = workflow.jobs['windows-backup-dotnet'];
expect(job['runs-on']).toBe('${{ matrix.runner }}');
- expect(job['timeout-minutes']).toBe(5);
expect(job.strategy['fail-fast']).toBe(false);
expect(job.strategy.matrix.runner).toEqual(['windows-2022', 'windows-11-arm']);
expect(job.strategy.matrix.bun).toEqual(['1.4.0', '1.4.4']);
@@ -92,6 +92,20 @@ describe('data-safety native CI coverage', () => {
expect(workflow.jobs['windows-backup-console'].steps.some(entry => entry.env?.GBRAIN_TEST_BACKUP_DOTNET_PROBE !== undefined)).toBe(false);
});
+ // GitHub counts "Set up job" against timeout-minutes: one windows-11-arm job spent 218 s there and the old 5-minute
+ // limit cancelled its passed probe. A stalled step must fail at its own bound, never as a job cancel after it passed.
+ for (const [name, probe, tests] of [['windows-backup-console', 'Compare native hidden-window launch behavior', 1],
+ ['windows-backup-dotnet', 'Compare cmdlet and direct dotnet ACL programs', 2]] as const) test(`${name}: every step is bounded, and the job limit is the step bounds plus 5 minutes of runner setup`, () => {
+ const job = workflow.jobs[name];
+ for (const step of job.steps) expect([step.name ?? step.uses ?? step.run, step['timeout-minutes']]).toEqual([step.name ?? step.uses ?? step.run, expect.any(Number)]);
+ const bounds = job.steps.map(step => step['timeout-minutes']!);
+ expect(job['timeout-minutes']).toBe(5 + bounds.reduce((sum, minutes) => sum + minutes, 0));
+ // The probe step outlasts bun's own per-test timeout for each of its tests, so a stuck test is reported by bun first.
+ const step = job.steps.find(entry => entry.name === probe)!;
+ const perTest = Number(/--timeout=(\d+)/.exec(step.run!)![1]) / 1000;
+ expect(step['timeout-minutes']! * 60).toBeGreaterThan(perTest * tests);
+ });
+
test('the cmdlet arm retains the exact original encoded protection program', () => {
const program = readFileSync(join(import.meta.dir, '../fixtures/windows-backup-cmdlet-protect.ps1'), 'utf8').replace(/\r\n/g, '\n');
expect(createHash('sha256').update(Buffer.from(program, 'utf16le')).digest('hex'))