summaryrefslogtreecommitdiff
path: root/cli/tests
diff options
context:
space:
mode:
authorIgor Zinkovsky <igor@deno.com>2023-09-26 20:06:57 -0700
committerGitHub <noreply@github.com>2023-09-26 20:06:57 -0700
commitf0a022bed4c8ca46c472c6361f1793cb29f73480 (patch)
tree4f88ffcd77e94292a8696111ba6828a197eb153e /cli/tests
parentb433133a1ff1c329b05ce024d8db5fefb8f7b431 (diff)
fix(kv_queues): graceful shutdown (#20627)
This fixes the `TypeError: Database closed` error during shutdown.
Diffstat (limited to 'cli/tests')
-rw-r--r--cli/tests/unit/kv_test.ts10
1 files changed, 10 insertions, 0 deletions
diff --git a/cli/tests/unit/kv_test.ts b/cli/tests/unit/kv_test.ts
index da5dba6af..25abf4cde 100644
--- a/cli/tests/unit/kv_test.ts
+++ b/cli/tests/unit/kv_test.ts
@@ -1819,6 +1819,16 @@ Deno.test({
},
});
+Deno.test({
+ name: "queue graceful close",
+ async fn() {
+ const db: Deno.Kv = await Deno.openKv(":memory:");
+ const listener = db.listenQueue((_msg) => {});
+ db.close();
+ await listener;
+ },
+});
+
dbTest("atomic operation is exposed", (db) => {
assert(Deno.AtomicOperation);
const ao = db.atomic();