0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-03-03 09:31:22 -05:00

chore(kv) another fix for queue flaky test (#19513)

This commit is contained in:
Igor Zinkovsky 2023-06-14 16:27:59 -07:00 committed by GitHub
parent 84c793275b
commit c71c497b1b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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
}
}
},
});