An invalid environment-provided batch size stops the checked Boot process before it prints a bound value.
Spring Boot environment validation: fail before a worker starts
Reject the effective value
The probe binds relay.batch-size to an integer constrained from 1 through 100. With RELAY_BATCHSIZE=0, the child exits nonzero and never emits BOUND_BATCH. This tests validation after the environment source has been selected. The typed startup rule is the reason the worker should not quietly run with zero rows per tick.
A default of 8 is present, yet the explicit zero still fails. The default does not rescue an invalid higher-priority setting. This is different from a missing variable, which can legitimately leave the default in place under this fixture. A production requirement might reject absence too.
Failure is not an operational rollout test
The process test checks an exit code and lack of successful output. It does not prove that a load balancer removed the instance, that a retrying orchestrator backed off, or that no work was already in flight. The health boundary and the drain contract cover separate release behavior.
Checked source
RELAY_BATCHSIZE=0 java -cp "$CLASSPATH" in.aitrove.contracts.RelaySettingsProcessProbe
# Nonzero exit; no BOUND_BATCH lineVerification boundary
RelaySettingsProcessTest.invalidEnvironmentValuePreventsStartup. The source kit contains the full test and entry point.
Common Mistakes
- Do not validate only the programmatic default.
- Do not treat absence and an explicitly invalid value as the same case.
- Do not claim a failing probe proves deployment traffic was drained.
Read next
Spring Boot environment binding: prove the value in a child JVM, Spring Boot configuration validation: reject an unusable relay before work starts, Spring Boot configuration sources: test each deployment path, not a guessed order, Spring Boot liveness versus readiness: do not restart on every dependency outage.
