test: make the Darwin migration path and the query-timeout SKIP deterministic on Linux CI

The v1.65 migration suite relied on the host being macOS — on the
ubicloud runner the script's uname gate early-exited every test with
empty output; a Darwin uname shim in the shared setup runs the real
path everywhere (the non-Darwin test still overrides it with Linux).
The 1ms-budget brain-context test assumed 1ms is always too short; the
runner's fake gbrain answered in 0ms and no SKIP printed — the fake now
sleeps 300ms so the timeout is a certainty, while --version stays
instant for the detection assertion.
This commit is contained in:
Garry Tan
2026-08-15 11:24:27 -07:00
parent cac9888831
commit b972cedff7
2 changed files with 26 additions and 1 deletions
+7
View File
@@ -109,6 +109,13 @@ beforeEach(() => {
pwCache = path.join(tmpHome, 'pw-cache', 'ms-playwright');
fs.mkdirSync(pwCache, { recursive: true });
fs.mkdirSync(path.join(tmpHome, '.gstack'), { recursive: true });
// The migration gates on `uname -s` = Darwin; on the Linux CI runner the
// real uname made every test early-exit with empty output. Shim Darwin so
// the Darwin-path tests run everywhere; the non-Darwin test overwrites
// this shim with its own Linux uname.
fs.writeFileSync(path.join(fakeBinDir, 'uname'), '#!/bin/bash\necho Darwin\n', {
mode: 0o755,
});
});
afterEach(() => {