diff --git a/test/helpers/index.js b/test/helpers/index.js index d8b3ebe4..5942a883 100644 --- a/test/helpers/index.js +++ b/test/helpers/index.js @@ -78,14 +78,11 @@ function createBase (store, key, t, opts = {}) { base.maxSupportedVersion = opts.maxSupportedVersion } - t.teardown(() => { - return new Promise(resolve => { - const c = [] - c.push(base.close()) - setImmediate(() => c.push(base._viewStore.close())) - - Promise.all(c).then(resolve) - }) + t.teardown(async () => { + // this just cancels pending view gets, no need to await + setImmediate(() => base._viewStore.close().catch(() => {})) + + await base.close().catch(() => {}) }, { order: 1 }) return base diff --git a/test/suspend.js b/test/suspend.js index 8cb94721..3c7a1e6f 100644 --- a/test/suspend.js +++ b/test/suspend.js @@ -679,7 +679,8 @@ test('suspend - non-indexed writer catches up', async t => { await b.close() - await t.execution(createBase(stores[1], a.local.key, t)) + const reopened = createBase(stores[1], a.local.key, t) + await t.execution(reopened.ready()) t.pass('did not fail on open')