SC312 means the active workload ended before shutdown-check could send the
new request. Without older work still draining, the test cannot prove how the
service handles traffic during a drain.
| Code | SC312 FAIL |
|---|---|
| Stage | Draining traffic |
| CLI exit code | 1 |
| What it means | The in-flight work had already finished when the new request was due, so rejection during drain could not be observed. |
| Message |
|
| First thing to check | Use a longer-running test workload, so old work is still draining when the new request is sent. |
How do I fix it?
- Make the controlled workload run longer.
- Withdraw readiness immediately after
SIGTERM. - Remove unnecessary delays before changing the readiness state.
- Keep the new-request route fast enough to return before the deadline.
The workload should stay active long enough for readiness polling and the new
request, but still finish comfortably before shutdown.deadlineMs.
Do not disable the rejection check merely to hide the timing problem. If your production platform can route traffic during shutdown, keep the check and make the test window reliable.
How do I verify the fix?
The corrected order is readiness withdrawn, then new request rejected,
then work request finished. Run several times on CI to confirm the old work
does not finish first under load.
If readiness withdrawal itself is slow, fix that state change rather than adding an excessive artificial delay to the workload.