Skip to content

Commit

Permalink
better CI stability (#809)
Browse files Browse the repository at this point in the history
Signed-off-by: Matteo Collina <hello@matteocollina.com>
  • Loading branch information
mcollina committed Jun 9, 2022
1 parent ef154c5 commit f6f8dc1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ const plugin = fp(async function (app, opts) {
}
}, {
name: 'mercurius',
fastify: '>=3.x'
fastify: '4.x'
})

plugin.ErrorWithProps = ErrorWithProps
Expand Down
18 changes: 12 additions & 6 deletions test/gateway/remote-services.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,20 @@ test('Returns schema related errors for mandatory services', async (t) => {
const gateway = Fastify()

t.teardown(async () => {
await gateway.close()
await service.close()
await Promise.all([
gateway.close(),
service.close()
])
})

gateway.register(GQL, {
gateway: {
services: [{
name: 'not-working',
url: `http://localhost:${servicePort}/graphql`,
mandatory: true
mandatory: true,
keepAliveTimeout: 10, // milliseconds
keepAliveMaxTimeout: 10 // milliseconds
}]
}
})
Expand All @@ -95,9 +99,11 @@ test('Does not error if at least one service schema is valid', async (t) => {
}

t.teardown(async () => {
await gateway.close()
await service.close()
await invalidService.close()
await Promise.all([
gateway.close(),
service.close(),
invalidService.close()
])
})

gateway.register(GQL, {
Expand Down

0 comments on commit f6f8dc1

Please sign in to comment.