diff --git a/identity/tests/did-cache_test.ts b/identity/tests/did-cache_test.ts index 7b5a314..fc3f1f5 100644 --- a/identity/tests/did-cache_test.ts +++ b/identity/tests/did-cache_test.ts @@ -83,7 +83,7 @@ Deno.test({ // let's mess with the cached doc so we get something different didCache.cacheDid(did, { ...doc, id: "did:example:alice" }); - await wait(5); + await wait(1); // first check the cache & see that we have the stale value const cached = shortCacheResolver.cache?.checkCache(did); @@ -112,7 +112,7 @@ Deno.test({ // again, we mess with the cached doc so we get something different didCache.cacheDid(did, { ...doc, id: "did:example:alice" }); - await wait(5); + await wait(1); // see that the resolver does not return expired value & instead force refreshes const staleGet = await shortExpireResolver.resolve(did); diff --git a/repo/tests/car_test.ts b/repo/tests/car_test.ts index 1d1fd1c..de8d1dd 100644 --- a/repo/tests/car_test.ts +++ b/repo/tests/car_test.ts @@ -44,7 +44,7 @@ for (const fixture of fixtures) { Deno.test("writeCar propagates errors", async () => { const iterate = async () => { async function* blockIterator() { - await wait(1); + await wait(0); const block = await dataToCborBlock({ test: 1 }); yield block; throw new Error("Oops!"); diff --git a/sync/tests/runner_test.ts b/sync/tests/runner_test.ts index 42636c4..ca5bb53 100644 --- a/sync/tests/runner_test.ts +++ b/sync/tests/runner_test.ts @@ -29,21 +29,21 @@ Deno.test("MemoryRunner performs work in parallel across partitions, serial with const complete: number[] = []; // partition 1 items start slow but get faster: slow should still complete first. runner.addTask("1", async () => { - await wait(30); + await wait(8); complete.push(11); }); runner.addTask("1", async () => { - await wait(20); + await wait(4); complete.push(12); }); runner.addTask("1", async () => { - await wait(1); + await wait(0); complete.push(13); }); assertEquals(runner.partitions.size, 1); // partition 2 items complete quickly except the last, which is slowest of all events. runner.addTask("2", async () => { - await wait(1); + await wait(0); complete.push(21); }); runner.addTask("2", async () => { @@ -55,7 +55,7 @@ Deno.test("MemoryRunner performs work in parallel across partitions, serial with complete.push(23); }); runner.addTask("2", async () => { - await wait(60); + await wait(10); complete.push(24); }); assertEquals(runner.partitions.size, 2); @@ -70,11 +70,11 @@ Deno.test("MemoryRunner limits overall concurrency.", async () => { // if concurrency were not constrained, partition 1 would complete all items // before any items from partition 2. since it is constrained, the work is complete in the order added. runner.addTask("1", async () => { - await wait(1); + await wait(0); complete.push(11); }); runner.addTask("2", async () => { - await wait(10); + await wait(2); complete.push(21); }); runner.addTask("1", async () => { @@ -82,7 +82,7 @@ Deno.test("MemoryRunner limits overall concurrency.", async () => { complete.push(12); }); runner.addTask("2", async () => { - await wait(10); + await wait(5); complete.push(22); }); // only partition 1 exists so far due to the concurrency