Skip to content

Commit

Permalink
WIP: try to fix tests on AppVeyor
Browse files Browse the repository at this point in the history
  • Loading branch information
taratatach committed Oct 4, 2023
1 parent f0e128d commit 5b845f2
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion test/support/helpers/pouch.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,16 @@ module.exports = {

async cleanDatabase() {
if (this.pouch && this.pouch.db) {
await this.pouch.db.destroy()
let retry = 0
do {
try {
await this.pouch.db.destroy()
break
} catch (err) {
retry++
await Promise.delay(500 * 2 ** retry)
}
} while (retry < 3)
}
this.pouch = null
},
Expand Down

0 comments on commit 5b845f2

Please sign in to comment.