Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unit & Integration Test timed out #21

Open
dina75 opened this issue Sep 1, 2023 · 1 comment
Open

Unit & Integration Test timed out #21

dina75 opened this issue Sep 1, 2023 · 1 comment

Comments

@dina75
Copy link

dina75 commented Sep 1, 2023

I have added fastify-custom-healthcheck for extending health functionalities of my app. but when i run my unit or integration tests it was failing at the time of hitting app.ready() and didn't even throw any valid errors other than 'Exceeded timeout of 5000 ms for a hook'. When i run without 'fastify-custom-healthcheck', it works fine. I will appreciate your help, if anyone can

*Code snippet
fastify
.register(customHealthCheck, {
path: ${routePrefix}/health/check,
info: { message: 'HealthCheck' },
exposeFailure: true
})
.then(() => {
astify.addHealthCheck('sync', () => true)
})

@gkampitakis
Copy link
Owner

I am not able to reproduce 🤔

Node Version: v18.16.0
fastify: "^4.22.2"
"fastify-custom-healthcheck": "^3.1.0"

// Require the framework and instantiate it
const fastify = require('fastify')({ logger: true })
const customHealthCheck = require('fastify-custom-healthCheck');

fastify
  .register(customHealthCheck, {
    path: "/health/check",
    info: { message: 'HealthCheck' },
    exposeFailure: true
  })
  .then(() => {
    fastify.addHealthCheck('sync', () => true)
  })


fastify.ready().then(() => {
  console.log("everything ready")
}).then(() => {
  // Run the server!
  fastify.listen({ port: 3000 }, (err) => {
    if (err) {
      fastify.log.error(err)
      process.exit(1)
    }
  })
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants