Files
Zack TannerandGitHub c2ac8df073 add better logs around worker restarts (#57004)
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)
2023-10-18 16:11:40 +00:00

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'
)
})
})