mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
We currently log when a worker is restarted but not when we send the kill signal, which can create a delta in logs of cryptic errors while the worker is exiting. This explicitly logs when we're terminating the static worker prior to a restart, and also adds an optional logger fn so that we pretty-print the messages. [slack x-ref](https://vercel.slack.com/archives/C061DJBG8PN/p1697491350970269)
28 lines
958 B
TypeScript
28 lines
958 B
TypeScript
import { nextBuild } from 'next-test-utils'
|
|
|
|
describe('worker-restart', () => {
|
|
it('should properly exhaust all restart attempts and not fail with any worker errors', async () => {
|
|
const { stdout, stderr } = await nextBuild(__dirname, [], {
|
|
stdout: true,
|
|
stderr: true,
|
|
})
|
|
|
|
const output = stdout + stderr
|
|
expect(output).toContain(
|
|
'Sending SIGTERM signal to static worker due to timeout of 10 seconds. Subsequent errors may be a result of the worker exiting.'
|
|
)
|
|
expect(output).toContain(
|
|
'Static worker exited with code: null and signal: SIGTERM'
|
|
)
|
|
expect(output).toContain(
|
|
'Restarted static page generation for /bad-page because it took more than 10 seconds'
|
|
)
|
|
expect(output).toContain(
|
|
'Static page generation for /bad-page is still timing out after 3 attempts'
|
|
)
|
|
expect(output).not.toContain(
|
|
'Error: Farm is ended, no more calls can be done to it'
|
|
)
|
|
})
|
|
})
|