web: fix /-/ready stopping header and add tests#17795
web: fix /-/ready stopping header and add tests#17795bboreham merged 1 commit intoprometheus:mainfrom
Conversation
Signed-off-by: Chuanye Gao <jamesgaoctf@gmail.com>
|
Thanks for this. Can you clarify please: is this to fix a regression or has it been broken for a while? |
|
Also can you clarify: is this purely to do with tests, or does it change the behaviour seen when calling If the latter, |
|
@Apolonia-Vitali-Corleone thank you for the PR. @bboreham This is appears to be a real |
|
Thanks @juliusmh. Still trying to get this precise...
I see two cases in the code for I also observe that the UI code seems to only check for |
What this PR does
X-Prometheus-Stoppingheader issue for the/-/readyendpoint when Prometheus is inNotReadystate (previously, the header was never sent for this state).X-Prometheus-Stopping: falseis returned forNotReadystate.X-Prometheus-Stopping: trueis returned forStoppingstate.GETandHEADrequests to the/-/readyendpoint.Why
The existing tests only asserted HTTP status codes and did not verify the presence or value of the
X-Prometheus-Stoppingheader, which could cause unclear readiness status signals.Notes
The test assertions are intentionally kept explicit to make the readiness state transitions
(
NotReady→Stopping→Ready) and their HTTP behavior easy to read and debug.If a more DRY-style test structure is preferred, I’m happy to follow up and refactor accordingly.
Which issue(s) does the PR fix:
NONE
Does this PR introduce a user-facing change?