Skip to content

Commit

Permalink
Teardown test bases that use tmpDir (#48)
Browse files Browse the repository at this point in the history
* teardown bases that use tmpDir

* teardown order matters

* reenable windows ci

* teardown corestore as well

* fix suspend tests
  • Loading branch information
chm-diederichs authored Feb 19, 2024
1 parent 45f49d6 commit 7562c13
Show file tree
Hide file tree
Showing 4 changed files with 183 additions and 100 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
strategy:
matrix:
node-version: [lts/*]
os: [ubuntu-latest, macos-latest]
os: [ubuntu-latest, macos-latest, windows-latest]
timeout-minutes: 30
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 https://github.com/actions/checkout/releases/tag/v4.1.1
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"random-access-memory": "^6.2.0",
"same-data": "^1.0.0",
"standard": "^17.0.0",
"test-tmp": "^1.0.0"
"test-tmp": "^1.2.0"
},
"standard": {
"ignore": [
Expand Down
46 changes: 46 additions & 0 deletions test/fast-forward.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ test('fast-forward - simple', async t => {

await b.ready()

t.teardown(async () => {
await a.close()
await b.close()
await store.close()
await store2.close()
})

for (let i = 0; i < 1000; i++) {
await a.append('a' + i)
}
Expand All @@ -72,6 +79,12 @@ test('fast-forward - migrate', async t => {
storage: () => tmpDir(t)
})

t.teardown(async () => {
await a.close()
await b.close()
await c.close()
})

for (let i = 0; i < 2000; i++) {
await a.append('a' + i)
}
Expand Down Expand Up @@ -103,6 +116,12 @@ test('fast-forward - fast forward after migrate', async t => {
storage: () => tmpDir(t)
})

t.teardown(async () => {
await a.close()
await b.close()
await c.close()
})

for (let i = 0; i < 2000; i++) {
await a.append('a' + i)
}
Expand Down Expand Up @@ -156,6 +175,13 @@ test('fast-forward - multiple writers added', async t => {
storage: () => tmpDir(t)
})

t.teardown(async () => {
await a.close()
await b.close()
await c.close()
await d.close()
})

await addWriterAndSync(a, b)
await addWriterAndSync(a, c)

Expand Down Expand Up @@ -208,6 +234,13 @@ test('fast-forward - multiple queues', async t => {
storage: () => tmpDir(t)
})

t.teardown(async () => {
await a.close()
await b.close()
await c.close()
await d.close()
}, { order: 1 })

// this value should be long enough that 2 fast-forwards are
// queued (ie. we don't just replicate the last state), but short
// enough that the second is queued before the first has completed
Expand Down Expand Up @@ -348,6 +381,13 @@ test('fast-forward - open with no remote io', async t => {
ackThreshold: 0
})

t.teardown(async () => {
await a.close()
await b2.close()
await store.close()
await store2.close()
})

await b2.ready()
await t.execution(b2.ready())

Expand Down Expand Up @@ -381,6 +421,12 @@ test('fast-forward - force reset then ff', async t => {
storage: () => tmpDir(t)
})

t.teardown(async () => {
await a.close()
await b.close()
await c.close()
})

await addWriterAndSync(a, b)
await addWriterAndSync(a, c)
await confirm([a, b, c])
Expand Down
Loading

0 comments on commit 7562c13

Please sign in to comment.