fix(testing): use UUIDs for Parallels background scripts

This commit is contained in:
Vincent Koc
2026-06-17 15:15:51 +02:00
parent 97ce204d97
commit 2ab883a7b8
2 changed files with 2 additions and 1 deletions

View File

@@ -70,7 +70,7 @@ export async function runWindowsBackgroundPowerShell(
const pollIntervalMs = Math.max(1, Math.floor(options.pollIntervalMs ?? 5_000));
const runCommand = options.runCommand ?? run;
const safeLabel = options.label.replaceAll(/[^A-Za-z0-9_-]/g, "-");
const nonce = `${safeLabel}-${Date.now()}-${Math.floor(Math.random() * 100000)}`;
const nonce = `${safeLabel}-${randomUUID()}`;
const fileBase = `openclaw-parallels-${nonce}`;
const pathsScript = `$base = Join-Path $env:TEMP ${psSingleQuote(fileBase)}
$scriptPath = "$base.ps1"

View File

@@ -1045,6 +1045,7 @@ if (isPrlctl) {
expect(guestTransports).toContain("guestScriptName");
expect(guestTransports).not.toContain("Date.now()}.sh");
expect(guestTransports).not.toContain("Date.now()}.ps1");
expect(guestTransports).not.toContain("Math.random()");
});
it("hardens restored macOS install lanes", () => {