summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Zinkovsky <igor@deno.com>2023-06-14 16:27:59 -0700
committerGitHub <noreply@github.com>2023-06-14 16:27:59 -0700
commitc71c497b1b315d5c6c36feada06961f8a341aa76 (patch)
tree3383ef0aef46ddb45c7b89d6d5081b37b430793b
parent84c793275b324c262dde02a432462565584c83f7 (diff)
chore(kv) another fix for queue flaky test (#19513)
-rw-r--r--cli/tests/unit/kv_test.ts21
1 files changed, 12 insertions, 9 deletions
diff --git a/cli/tests/unit/kv_test.ts b/cli/tests/unit/kv_test.ts
index 439dcfe2c..64be843be 100644
--- a/cli/tests/unit/kv_test.ts
+++ b/cli/tests/unit/kv_test.ts
@@ -1640,12 +1640,7 @@ Deno.test({
sanitizeOps: false,
sanitizeResources: false,
async fn() {
- const filename = "cli/tests/testdata/queue.db";
- try {
- await Deno.remove(filename);
- } catch {
- // pass
- }
+ const filename = await Deno.makeTempFile({ prefix: "queue_db" });
try {
let db: Deno.Kv = await Deno.openKv(filename);
@@ -1691,7 +1686,11 @@ Deno.test({
db.close();
await listener;
} finally {
- await Deno.remove(filename);
+ try {
+ await Deno.remove(filename);
+ } catch {
+ // pass
+ }
}
},
});
@@ -1701,7 +1700,7 @@ Deno.test({
async fn() {
const dispatchedPre = Deno.metrics().opsDispatchedAsync;
const completedPre = Deno.metrics().opsCompletedAsync;
- const filename = "cli/tests/testdata/queue.db";
+ const filename = await Deno.makeTempFile({ prefix: "queue_db" });
try {
await Deno.remove(filename);
} catch {
@@ -1753,7 +1752,11 @@ Deno.test({
completed = Deno.metrics().opsCompletedAsync - completedPre;
await sleep(100);
}
- await Deno.remove(filename);
+ try {
+ await Deno.remove(filename);
+ } catch {
+ // pass
+ }
}
},
});