Skip to content

Commit 36accde

Browse files
committed
test(apple-runner): skip the third unreadable-lease test under uid 0
Root reads a mode-000 lease file, so the owner-cleanup case next to an unreadable lease proves nothing there. CONTRIBUTING now states the full gate's two exclusions in the same terms as docs/agents/testing.md. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016qAu53rMak1bXMuR5U2gF4
1 parent 379ef96 commit 36accde

2 files changed

Lines changed: 30 additions & 22 deletions

File tree

‎CONTRIBUTING.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,9 @@ Only a passed receipt with `exactCommit: true` proves validation at that commit.
218218
the run also includes staged, unstaged, and untracked files; treat that result as local feedback.
219219
Unknown, workflow, lockfile, and selector-owning changes fail open to the full local set. For broad
220220
refactors or when explicitly requested, run `pnpm check`. It runs every gate that the catalog in
221-
`scripts/check-affected/checks.ts` marks `localRunnable`; the catalog, not this page, is the list.
222-
The unit suite it runs includes the `apple-runner` project. Both commands share one host lock and
221+
`scripts/check-affected/checks.ts` marks `localRunnable`, except `vitest-related`, which the full
222+
unit suite replaces, and the checks that suite already runs. The catalog, not this page, is the
223+
list. The unit suite includes the `apple-runner` project. Both commands share one host lock and
223224
need macOS or Linux; on Windows, use the affected plan and direct focused checks. Checks marked
224225
`localRunnable: false` stay GitHub-authoritative: coverage, specialized toolchains, long scheduled
225226
sweeps, and live device lanes.

‎packages/apple-runner/src/__tests__/runner-cache-retention.test.ts‎

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -234,27 +234,34 @@ test.skipIf(process.getuid?.() === 0)(
234234
},
235235
);
236236

237-
test('owner cleanup still stops a readable lease next to an unreadable lease file', async () => {
238-
const owned = leaseFor(seedKey(key(1), 0), { ownerPid: 4242, ownerStartTime: null });
239-
writeRunnerLease(owned);
240-
const unreadable = path.join(process.env.AGENT_DEVICE_IOS_RUNNER_LEASE_DIR!, 'a-unreadable.json');
241-
fs.writeFileSync(unreadable, '{}');
242-
fs.chmodSync(unreadable, 0o000);
243-
const cleanupTempFile = vi.fn(async () => {});
244-
245-
await cleanupRunnerLeasesForOwner(
246-
{ pid: 4242, startTime: null },
247-
{
248-
confirmRunnerTermination: async () => true,
249-
enableIosSimulatorAppAccessibility: async () => {},
250-
cleanupRunnerProcessTree: async () => {},
251-
cleanupRunnerXcodebuildProcesses: async () => {},
252-
cleanupTempFile,
253-
},
254-
);
237+
// Root reads a mode-000 path, so the unreadable case cannot exist under uid 0.
238+
test.skipIf(process.getuid?.() === 0)(
239+
'owner cleanup still stops a readable lease next to an unreadable lease file',
240+
async () => {
241+
const owned = leaseFor(seedKey(key(1), 0), { ownerPid: 4242, ownerStartTime: null });
242+
writeRunnerLease(owned);
243+
const unreadable = path.join(
244+
process.env.AGENT_DEVICE_IOS_RUNNER_LEASE_DIR!,
245+
'a-unreadable.json',
246+
);
247+
fs.writeFileSync(unreadable, '{}');
248+
fs.chmodSync(unreadable, 0o000);
249+
const cleanupTempFile = vi.fn(async () => {});
250+
251+
await cleanupRunnerLeasesForOwner(
252+
{ pid: 4242, startTime: null },
253+
{
254+
confirmRunnerTermination: async () => true,
255+
enableIosSimulatorAppAccessibility: async () => {},
256+
cleanupRunnerProcessTree: async () => {},
257+
cleanupRunnerXcodebuildProcesses: async () => {},
258+
cleanupTempFile,
259+
},
260+
);
255261

256-
assert.deepEqual(cleanupTempFile.mock.calls, [[owned.xctestrunPath], [owned.jsonPath]]);
257-
});
262+
assert.deepEqual(cleanupTempFile.mock.calls, [[owned.xctestrunPath], [owned.jsonPath]]);
263+
},
264+
);
258265

259266
test('a keep count of 0 turns eviction off', async () => {
260267
process.env.AGENT_DEVICE_IOS_RUNNER_CACHE_KEEP = '0';

0 commit comments

Comments
 (0)