Skip to content

Commit 7fbae99

Browse files
committed
improve test reliability
1 parent 11477a0 commit 7fbae99

File tree

18 files changed

+36
-0
lines changed

18 files changed

+36
-0
lines changed

exercises/03.resources/01.problem.simple/src/index.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ async function setupClient({ capabilities }: ClientOptions = {}) {
3838
EPIC_ME_DB_PATH,
3939
async [Symbol.asyncDispose]() {
4040
await client.transport?.close()
41+
// give things a moment to release locks and whatnot
42+
await new Promise((r) => setTimeout(r, 100))
4143
await fs.unlink(EPIC_ME_DB_PATH)
4244
},
4345
}

exercises/03.resources/01.solution.simple/src/index.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ async function setupClient({ capabilities }: ClientOptions = {}) {
3838
EPIC_ME_DB_PATH,
3939
async [Symbol.asyncDispose]() {
4040
await client.transport?.close()
41+
// give things a moment to release locks and whatnot
42+
await new Promise((r) => setTimeout(r, 100))
4143
await fs.unlink(EPIC_ME_DB_PATH)
4244
},
4345
}

exercises/03.resources/02.problem.template/src/index.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ async function setupClient({ capabilities }: ClientOptions = {}) {
3838
EPIC_ME_DB_PATH,
3939
async [Symbol.asyncDispose]() {
4040
await client.transport?.close()
41+
// give things a moment to release locks and whatnot
42+
await new Promise((r) => setTimeout(r, 100))
4143
await fs.unlink(EPIC_ME_DB_PATH)
4244
},
4345
}

exercises/03.resources/02.solution.template/src/index.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ async function setupClient({ capabilities }: ClientOptions = {}) {
3838
EPIC_ME_DB_PATH,
3939
async [Symbol.asyncDispose]() {
4040
await client.transport?.close()
41+
// give things a moment to release locks and whatnot
42+
await new Promise((r) => setTimeout(r, 100))
4143
await fs.unlink(EPIC_ME_DB_PATH)
4244
},
4345
}

exercises/03.resources/03.problem.list/src/index.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ async function setupClient({ capabilities }: ClientOptions = {}) {
3838
EPIC_ME_DB_PATH,
3939
async [Symbol.asyncDispose]() {
4040
await client.transport?.close()
41+
// give things a moment to release locks and whatnot
42+
await new Promise((r) => setTimeout(r, 100))
4143
await fs.unlink(EPIC_ME_DB_PATH)
4244
},
4345
}

exercises/03.resources/03.solution.list/src/index.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ async function setupClient({ capabilities }: ClientOptions = {}) {
3838
EPIC_ME_DB_PATH,
3939
async [Symbol.asyncDispose]() {
4040
await client.transport?.close()
41+
// give things a moment to release locks and whatnot
42+
await new Promise((r) => setTimeout(r, 100))
4143
await fs.unlink(EPIC_ME_DB_PATH)
4244
},
4345
}

exercises/03.resources/04.problem.completion/src/index.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ async function setupClient({ capabilities }: ClientOptions = {}) {
3838
EPIC_ME_DB_PATH,
3939
async [Symbol.asyncDispose]() {
4040
await client.transport?.close()
41+
// give things a moment to release locks and whatnot
42+
await new Promise((r) => setTimeout(r, 100))
4143
await fs.unlink(EPIC_ME_DB_PATH)
4244
},
4345
}

exercises/03.resources/04.solution.completion/src/index.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ async function setupClient({ capabilities }: ClientOptions = {}) {
3838
EPIC_ME_DB_PATH,
3939
async [Symbol.asyncDispose]() {
4040
await client.transport?.close()
41+
// give things a moment to release locks and whatnot
42+
await new Promise((r) => setTimeout(r, 100))
4143
await fs.unlink(EPIC_ME_DB_PATH)
4244
},
4345
}

exercises/04.resource-tools/01.problem.embedded/src/index.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ async function setupClient() {
3535
EPIC_ME_DB_PATH,
3636
async [Symbol.asyncDispose]() {
3737
await client.transport?.close()
38+
// give things a moment to release locks and whatnot
39+
await new Promise((r) => setTimeout(r, 100))
3840
await fs.unlink(EPIC_ME_DB_PATH)
3941
},
4042
}

exercises/04.resource-tools/01.solution.embedded/src/index.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ async function setupClient() {
3535
EPIC_ME_DB_PATH,
3636
async [Symbol.asyncDispose]() {
3737
await client.transport?.close()
38+
// give things a moment to release locks and whatnot
39+
await new Promise((r) => setTimeout(r, 100))
3840
await fs.unlink(EPIC_ME_DB_PATH)
3941
},
4042
}

0 commit comments

Comments
 (0)