You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched existing issues to ensure the bug has not already been reported
Fastify version
10.0.1
Plugin version
No response
Node.js version
18.18.0
Operating system
Windows
Operating system version (i.e. 20.04, 11.3, 10)
10 pro
Description
I ask for help and want to apologize if this is my mistake and not yours. Perhaps I'm doing something wrong. In Jest tests, when closing fastify/nextjs (app.close()), nextjs does not close, but continues to work. It happened a couple of times that I didn’t stop the test and after 3-5 minutes I received logs about page compilation from nextjs.
In dev and prod mode everything works correctly and without errors.
Another very important point is that my CI freezes after passing the tests. Even if I use beforeAll and afterAll in the test, then after successful completion I get a warning : "Jest did not exit one second after the test run has completed.
'This usually means that there are asynchronous operations that weren't stopped in your tests. Consider running Jest with --detectOpenHandles to troubleshoot this issue." . I think this is due to the fact that Nextjs continues to work.
thrown: "Exceeded timeout of 5000 ms for a hook.
Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout."
19 | })
20 |
> 21 | afterEach(async () => {
| ^
22 | await app.close()
23 | })
24 |
at afterEach (src/app.test.ts:21:1)
thrown: "Exceeded timeout of 5000 ms for a hook.
Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout."
8 | let app: ReturnType<typeof createApp>
9 |
> 10 | beforeEach(async () => {
| ^
11 | app = createApp({
12 | logLevel: 'silent',
13 | formats: ['pdf', 'docx'],
at beforeEach (src/app.test.ts:10:1)
TypeError: fastify.next is not a function
47 | .register(fastifyNext, { dev: process.env.NODE_ENV !== 'production' })
48 | .after(() => {
> 49 | fastify.next('/web/viewer-new')
| ^
50 | })
51 |
52 | fastify.register(fastifyStatic, { root: PUBLIC_PATH, wildcard: false })
at next (src/app.ts:49:12)
at Object._encapsulateThreeParam (node_modules/avvio/boot.js:544:13)
at Boot.timeoutCall (node_modules/avvio/boot.js:458:5)
at Boot.callWithCbOrNextTick (node_modules/avvio/boot.js:440:19)
at Boot._after (node_modules/avvio/boot.js:280:26)
at Plugin.Object.<anonymous>.Plugin.exec (node_modules/avvio/plugin.js:130:19)
at Boot.loadPlugin (node_modules/avvio/plugin.js:272:10)
If in the beforeAll and afterAll test:
Run the test npm run test:coverage
All tests pass
I get a warning
warning:
"Jest did not exit one second after the test run has completed.
'This usually means that there are asynchronous operations that weren't stopped in your tests. Consider running Jest with --detectOpenHandles to troubleshoot this issue."
But in this case CI does not work.
Expected Behavior
No response
The text was updated successfully, but these errors were encountered:
Prerequisites
Fastify version
10.0.1
Plugin version
No response
Node.js version
18.18.0
Operating system
Windows
Operating system version (i.e. 20.04, 11.3, 10)
10 pro
Description
I ask for help and want to apologize if this is my mistake and not yours. Perhaps I'm doing something wrong. In Jest tests, when closing fastify/nextjs (app.close()), nextjs does not close, but continues to work. It happened a couple of times that I didn’t stop the test and after 3-5 minutes I received logs about page compilation from nextjs.
In dev and prod mode everything works correctly and without errors.
Another very important point is that my CI freezes after passing the tests. Even if I use beforeAll and afterAll in the test, then after successful completion I get a warning : "Jest did not exit one second after the test run has completed.
'This usually means that there are asynchronous operations that weren't stopped in your tests. Consider running Jest with
--detectOpenHandles
to troubleshoot this issue." . I think this is due to the fact that Nextjs continues to work.my test
my app
my index
Steps to Reproduce
If in the beforeEach and afterEach test:
If in the beforeAll and afterAll test:
warning:
"Jest did not exit one second after the test run has completed.
'This usually means that there are asynchronous operations that weren't stopped in your tests. Consider running Jest with
--detectOpenHandles
to troubleshoot this issue."But in this case CI does not work.
Expected Behavior
No response
The text was updated successfully, but these errors were encountered: