Skip to content

Commit d57c31b

Browse files
authored
do not close the datastore at end of test, because it prevent dht from flushing datastore resulting in an error message (#353)
1 parent d0f188f commit d57c31b

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

setup_test.go

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,7 @@ func testSeedPeering(t *testing.T, n int, dhtRouting DHTRouting, dhtSharedHost b
156156
cdns := newCachedDNS(dnsCacheRefreshInterval)
157157
defer cdns.Close()
158158

159-
ctx, cancel := context.WithCancel(context.Background())
160-
defer cancel()
159+
ctx := t.Context()
161160

162161
seed, err := newSeed()
163162
require.NoError(t, err)
@@ -197,13 +196,6 @@ func testSeedPeering(t *testing.T, n int, dhtRouting DHTRouting, dhtSharedHost b
197196
nodes[i], err = SetupWithLibp2p(ctx, cfgs[i], keys[i], cdns)
198197
require.NoError(t, err)
199198
}
200-
t.Cleanup(func() {
201-
for _, node := range nodes {
202-
if node.datastore != nil {
203-
node.datastore.Close()
204-
}
205-
}
206-
})
207199

208200
require.Eventually(t, func() bool {
209201
for i, node := range nodes {

0 commit comments

Comments
 (0)