Skip to content

Commit 6cb641c

Browse files
committed
test(win): scope ACL timeout fakes
1 parent 429fa3b commit 6cb641c

2 files changed

Lines changed: 11 additions & 5 deletions

File tree

tests/server-management-auth.test.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -482,10 +482,10 @@ describe("management and data-plane credential separation", () => {
482482
setPlatformForTests("win32");
483483
setIcaclsRunnerForTests(args => {
484484
const target = args[0] ?? "";
485-
if (target.endsWith("admin-api-token")) {
486-
return { success: true, exitCode: 0, timedOut: false, stdout: "" };
485+
if (target === testHome) {
486+
return { success: false, exitCode: null, timedOut: true, stdout: "" };
487487
}
488-
return { success: false, exitCode: null, timedOut: true, stdout: "" };
488+
return { success: true, exitCode: 0, timedOut: false, stdout: "" };
489489
});
490490
resetHardenedStateForTests();
491491
const state = initializeManagementAuthState(remoteConfig());
@@ -549,7 +549,13 @@ describe("management and data-plane credential separation", () => {
549549
saveConfig(remoteConfig());
550550
process.env.USERNAME ??= "tester";
551551
setPlatformForTests("win32");
552-
setIcaclsRunnerForTests(() => ({ success: false, exitCode: null, timedOut: true, stdout: "" }));
552+
setIcaclsRunnerForTests(args => {
553+
const target = args[0] ?? "";
554+
if (target === testHome || target.endsWith("admin-api-token")) {
555+
return { success: false, exitCode: null, timedOut: true, stdout: "" };
556+
}
557+
return { success: true, exitCode: 0, timedOut: false, stdout: "" };
558+
});
553559
resetHardenedStateForTests();
554560

555561
const state = initializeManagementAuthState(remoteConfig());

tests/usage-log.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ describe("usage log", () => {
8484
const snapshot = await readUsageSnapshotForManagement();
8585
expect(snapshot.truncatedPrefixBytes).toBeGreaterThan(0);
8686
expect(snapshot.entries.map(entry => entry.requestId)).toEqual(["tail"]);
87-
});
87+
}, STORE_BUDGET_MS); // sparse >64 MiB fixture IO is intrinsic; Windows self-hosted measured 7.193s against Bun's 5s default.
8888

8989
test("usage tail exact row boundary keeps the complete newest row", async () => {
9090
const newest = Buffer.from(`${persistedLine("newest")}\n`);

0 commit comments

Comments
 (0)