From a0f434c3fae6cf1eff7b3839f13d78bfa2771141 Mon Sep 17 00:00:00 2001 From: Hayden Young Date: Tue, 15 Oct 2024 12:59:47 +0100 Subject: [PATCH] test: Close ClassicLevel explicitly when stopping IPFS. --- test/orbitdb-replication.test.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test/orbitdb-replication.test.js b/test/orbitdb-replication.test.js index a6906a9..22bf910 100644 --- a/test/orbitdb-replication.test.js +++ b/test/orbitdb-replication.test.js @@ -23,8 +23,6 @@ describe('Replicating databases', function () { after(async () => { await orbitdb1.stop() await orbitdb2.stop() - await ipfs1.blockstore.child.child.close() - await ipfs2.blockstore.child.child.close() await ipfs1.stop() await ipfs2.stop() @@ -136,8 +134,12 @@ describe('Replicating databases', function () { await orbitdb1.stop() await orbitdb2.stop() - await ipfs1.blockstore.child.child.close() - await ipfs2.blockstore.child.child.close() + // TODO: Strange issue with ClassicLevel. Causes subsequent Helia + // instantiations to error with db closed. Explicitly closing the + // nested ClassicLevel db seems to resolve the issue. Requires further + // investigation. + await ipfs1.blockstore.child.child.child.close() + await ipfs2.blockstore.child.child.child.close() await ipfs1.stop() await ipfs2.stop()