Skip to content

Commit

Permalink
test: fix flaky tests (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
marco-ippolito authored Jan 27, 2023
1 parent eddd8be commit 49afc34
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions test/retry-failed-services.js
Original file line number Diff line number Diff line change
Expand Up @@ -392,20 +392,19 @@ test('gateway - should log error if retry throws', async t => {
)

let service2 = null

t.context.clock.setTimeout(async () => {
service2 = await createTestService(
5114,
postService.schema,
postService.resolvers
)
}, 2000)
}, 500)

const gateway = Fastify()

let errCount = 0
gateway.log.error = error => {
if (error.message.includes('kaboom') && errCount === 0) {
errCount++
if (error.message.includes('kaboom')) {
t.pass()
}
}
Expand Down

0 comments on commit 49afc34

Please sign in to comment.