Skip to content

Commit fb3143e

Browse files
committed
test(infra): give the LAN-host real PowerShell spawn a cold-start budget
checks-windows-node-test-2 (run 31804325922) hit the same cold-start flake class this PR fixes: the codepage-proof test spawns real powershell.exe bounded at 3s, which a cold runner cannot meet. Production keeps its fail-open 3s route-hint probe; only the test's real-spawn verification uses the shared cold-spawn budget.
1 parent dcc0bad commit fb3143e

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎src/infra/advertised-lan-host.windows.test.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@ import { describe, expect, it, vi } from "vitest";
33
import { runCommandWithTimeout } from "../process/exec.js";
44
import { resolveAdvertisedLanHostCore } from "./advertised-lan-host.js";
55
import type { NetworkInterfacesSnapshot } from "./network-interfaces.js";
6+
import { WINDOWS_POWERSHELL_COLD_SPAWN_TIMEOUT_MS } from "./windows-powershell-spawn.js";
67

78
type ResolveOptions = NonNullable<Parameters<typeof resolveAdvertisedLanHostCore>[0]>;
89
type RouteRunner = NonNullable<ResolveOptions["runCommandWithTimeout"]>;
9-
// This native probe validates PowerShell encoding, not the product's optional route-hint latency budget.
10-
const POWERSHELL_ENCODING_PROBE_TIMEOUT_MS = 10_000;
11-
1210
function ipv4(address: string) {
1311
return {
1412
address,
@@ -50,7 +48,9 @@ describe.runIf(process.platform === "win32")("advertised LAN host PowerShell con
5048
"-Command",
5149
`[Console]::OutputEncoding=[Text.Encoding]::GetEncoding(437); ${outputPrefix}[pscustomobject]@{InterfaceAlias='réseau-网卡';RouteMetric=1;InterfaceMetric=1} | ConvertTo-Json -Compress`,
5250
],
53-
{ timeoutMs: POWERSHELL_ENCODING_PROBE_TIMEOUT_MS, maxOutputBytes: 16 * 1024 },
51+
// Real spawn: cold PowerShell first-use can exceed the production 3s
52+
// fail-open probe budget; only production keeps the short bound.
53+
{ timeoutMs: WINDOWS_POWERSHELL_COLD_SPAWN_TIMEOUT_MS, maxOutputBytes: 16 * 1024 },
5454
);
5555
expect(result).toMatchObject({ code: 0 });
5656
expect(JSON.parse(result.stdout)).toMatchObject({ InterfaceAlias: "réseau-网卡" });

0 commit comments

Comments
 (0)