Shutdown Check

Search documentation

Find a page or section

shutdown-check v1.0.1

Test Node.js graceful shutdown before your users see a 502.

shutdown-check starts your real service, puts slow requests in flight and sends SIGTERM. Then it verifies those requests finish, readiness is withdrawn, new work is turned away and the process exits before the deadline, without a line of your code changing.

npm install -D shutdown-check

Any Node.js HTTP serverZero dependenciesNode.js 22+ on macOS and LinuxMIT

A graceful shutdown test, from SIGTERM to exit code

One service followed through the check: the run in your terminal, the file that sets it up, the drain on a timeline, what a failure tells you, and the gate in CI.

One command, a real SIGTERM

Your actual start command, a readiness check, real requests in flight, then the signal. Every step is timed.

No code changes

A JSON file names your start command, a readiness route and a slow route. Nothing is imported into your app.

A drain you can see

Requests finish, readiness drops to 503, new work is refused and the process exits well before the deadline.

Failures that say why

A stable code for the stage that broke, the timeline up to it, the service's own output and the fix.

Gate every deploy

Exit codes a job can fail on, JSON for scripts, and a JUnit report your CI already knows how to show.