From 0eb6ef2b362344e444e76eebf863fd214af40a94 Mon Sep 17 00:00:00 2001 From: Hyo Date: Tue, 1 Dec 2026 17:47:34 +0900 Subject: [PATCH 1/3] test: wait for the tree snapshot rate limit on real time instead of a step count The test polled a fixed number of fake-time steps for the first blob request. Run alone, the cold import of the backend modules outlasts those steps, so the assertion ran before indexing started; slow runners hit the same race inside the full suite. It now waits on real time, capped at ten seconds, while still moving fake time no further than before. --- .../treeSnapshotContinuation.test.ts | 31 ++++++++++++------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/test/convex/repoIndexing/treeSnapshotContinuation.test.ts b/test/convex/repoIndexing/treeSnapshotContinuation.test.ts index 57fe78a..a2ebb5b 100644 --- a/test/convex/repoIndexing/treeSnapshotContinuation.test.ts +++ b/test/convex/repoIndexing/treeSnapshotContinuation.test.ts @@ -94,6 +94,23 @@ async function yieldToRuntime(): Promise { }); } +/** + * Lets the backend run until `done`, bounded by real time rather than by a + * number of steps: a cold first import of the backend modules can take longer + * than any fixed count of fake-time steps. Fake time moves at most + * `maxFakeMs`, so jobs scheduled further out never run on their own. + */ +async function runUntil(done: () => boolean, maxFakeMs: number): Promise { + const deadline = process.hrtime.bigint() + 10_000_000_000n; + let fakeMs = 0; + while (!done() && process.hrtime.bigint() < deadline) { + const step = fakeMs < maxFakeMs ? 1 : 0; + await advanceTestTime(step); + fakeMs += step; + await yieldToRuntime(); + } +} + async function advanceTestTime(milliseconds: number): Promise { if (timerApi.advanceTimersByTimeAsync) { await timerApi.advanceTimersByTimeAsync(milliseconds); @@ -1795,12 +1812,7 @@ describe("repository tree snapshot continuations", () => { // Let the headerless secondary limit reach the durable retry path. Keeping // fake time below its one-minute fallback prevents convex-test from // auto-running the job that this assertion intentionally invokes manually. - for (let attempt = 0; attempt < 20; attempt++) { - await advanceTestTime(1); - if (blobCalls.get("rate-8") === 1) { - break; - } - } + await runUntil(() => blobCalls.get("rate-8") === 1, 20); expect(blobCalls.get("rate-8")).toBe(1); await expect(initialIndex).resolves.toMatchObject({ success: true, @@ -1832,12 +1844,7 @@ describe("repository tree snapshot continuations", () => { rateLimitResume: true, rateLimitRetryToken: deferred!.indexRateLimitRetryToken!, }); - for (let attempt = 0; attempt < 20; attempt++) { - await advanceTestTime(0); - if (successfulRetryPending) { - break; - } - } + await runUntil(() => successfulRetryPending, 0); expect(successfulRetryPending).toBe(true); await advanceTestTime(1); const retryResult = await retry; From ed23c860edcffd0ef80244e4bbe61d0a04440e0a Mon Sep 17 00:00:00 2001 From: Hyo Date: Tue, 1 Dec 2026 17:49:34 +0900 Subject: [PATCH 2/3] fix: update cross-spawn for its command injection advisory GHSA-ghv9-86vm-4v8m affects cross-spawn 7.0.x, which eslint pulls in for development only; 7.1.0 is the patched release in range. The lockfile also records the CLI's 0.6.0 version. --- bun.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bun.lock b/bun.lock index 904952a..213ca6c 100644 --- a/bun.lock +++ b/bun.lock @@ -55,7 +55,7 @@ }, "packages/cli": { "name": "gitdog", - "version": "0.5.1", + "version": "0.6.0", "bin": { "gitdog": "dist/cli.js", }, @@ -464,7 +464,7 @@ "cookie-es": ["cookie-es@3.1.1", "", {}, "sha512-UaXxwISYJPTr9hwQxMFYZ7kNhSXboMXP+Z3TRX6f1/NyaGPfuNUZOWP1pUEb75B2HjfklIYLVRfWiFZJyC6Npg=="], - "cross-spawn": ["cross-spawn@7.0.6", "", { "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", "which": "^2.0.1" } }, "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA=="], + "cross-spawn": ["cross-spawn@7.1.0", "", { "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", "which": "^2.0.1" } }, "sha512-/PHUIV1x/hZLpJN8KmyV2aYkT8pll4RjQ59TmhwkL/9B4HdOtlBQ2pos6iB2cfVRzpGHk3HXlRa8sdVYrPjIYw=="], "cssesc": ["cssesc@3.0.0", "", { "bin": { "cssesc": "bin/cssesc" } }, "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg=="], From 0fc99479d6f3366213a3d8062bbb1ce74a3fa48a Mon Sep 17 00:00:00 2001 From: Hyo Date: Tue, 1 Dec 2026 17:51:12 +0900 Subject: [PATCH 3/3] test: give the rate-limit test a timeout above its wait deadline --- test/convex/repoIndexing/treeSnapshotContinuation.test.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/convex/repoIndexing/treeSnapshotContinuation.test.ts b/test/convex/repoIndexing/treeSnapshotContinuation.test.ts index a2ebb5b..68c219c 100644 --- a/test/convex/repoIndexing/treeSnapshotContinuation.test.ts +++ b/test/convex/repoIndexing/treeSnapshotContinuation.test.ts @@ -98,7 +98,8 @@ async function yieldToRuntime(): Promise { * Lets the backend run until `done`, bounded by real time rather than by a * number of steps: a cold first import of the backend modules can take longer * than any fixed count of fake-time steps. Fake time moves at most - * `maxFakeMs`, so jobs scheduled further out never run on their own. + * `maxFakeMs`, so jobs scheduled further out never run on their own. A test + * that uses it needs a timeout above the ten-second deadline. */ async function runUntil(done: () => boolean, maxFakeMs: number): Promise { const deadline = process.hrtime.bigint() + 10_000_000_000n; @@ -1859,7 +1860,7 @@ describe("repository tree snapshot continuations", () => { expect(fileMaps).toHaveLength(10); expect(blobCalls.get("rate-8")).toBe(2); expect(blobCalls.get("rate-9")).toBe(1); - }); + }, 30_000); it("refetches after a late blob upload loses the publication fence", async () => { const t = convexTest(schema, modules);