Skip to content

Turbocharge Claude Code, Cursor, Codex, Gemini & every coding agent: faster, cheaper, with contextual understanding specific to your codebase.

test(windows): retry a probe that ran past its budget, and scale the 2 MB bar to the machine

Shrish Dwivedi93f837777773
diff --git a/test/skills-answers-prompt.test.ts b/test/skills-answers-prompt.test.ts
index 0433df91..557dbc50 100644
--- a/test/skills-answers-prompt.test.ts
+++ b/test/skills-answers-prompt.test.ts
@@ -15,6 +15,7 @@ import { compileRun, refusalWords, type CompileOpts } from "../src/skills/compil
import { callKind } from "../src/trace/checks.js";
import { isMultiLine } from "../src/trace/shell.js";
import type { RunCall, RunSheet } from "../src/trace/types.js";
+import { timeBar } from "./machine-speed.js";
const KEY = "github.com/acme/widget";
let seq = 0;
@@ -97,6 +98,6 @@ test("linear on a 2 MB command", () => {
answersPrompt(big);
best = Math.min(best, performance.now() - t);
}
- assert.ok(best < 1500, `took ${Math.round(best)} ms on ${big.length} chars`);
+ assert.ok(best < timeBar(1500, 4500), `took ${Math.round(best)} ms on ${big.length} chars`);
}
});
diff --git a/test/skills-probes-init-paths-1b.test.ts b/test/skills-probes-init-paths-1b.test.ts
index 8ff2597f..2041a642 100644
--- a/test/skills-probes-init-paths-1b.test.ts
+++ b/test/skills-probes-init-paths-1b.test.ts
@@ -66,7 +66,14 @@ const WIRING: Record<string, string> = {
let tick = 0;
/** One clean probe, past the 10-minute cache each time. */
function clean(b: { repo: string; env: NodeJS.ProcessEnv }) {
- return runProbes(cand(shipSkill({ ready: "git status --porcelain" })).skill, b.repo, new Date(NOW.getTime() + ++tick * 11 * 60_000), b.env)[0];
+ const at = new Date(NOW.getTime() + ++tick * 11 * 60_000);
+ // A slow git (a shared Windows runner) can run past the probes' 300 ms and return nothing; nothing is cached
+ // then, so the same probe at the same instant is simply asked again.
+ for (let k = 0; k < 5; k++) {
+ const r = runProbes(cand(shipSkill({ ready: "git status --porcelain" })).skill, b.repo, at, b.env)[0];
+ if (r) return r;
+ }
+ return undefined;
}
test("right after init, the paths it recorded read clean: a first init's untracked folders and a changed tracked file", () => {