Skip to content

Commit 4910bc5

Browse files
committed
test(e2e): wait for the opensearch handoff before the first API call
The first OpenSearch API call in the suite ran as soon as the data node reported Ready. At that point the operator's bootstrap pod can still be the elected cluster-manager, and until its own security configuration loads it answers a cluster-manager action such as an index create with 503. The operator deletes the pod only after it has left the committed voting configuration, so once the pod object is gone the cluster-manager is the Ready data node. The same Initialized flag that starts the handoff also releases a rolling restart that can be pending since first boot, and with one replica that restart takes the only node down. The step therefore also waits for the StatefulSet to settle on its update revision. Assisted-by: LLM Signed-off-by: Aleksei Sviridkin <[email protected]>
1 parent 564f540 commit 4910bc5

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

‎hack/e2e-chainsaw/opensearch/chainsaw-test.yaml‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,33 @@ spec:
197197
# roll below always has to get through a yellow cluster.
198198
- name: make-the-cluster-permanently-yellow
199199
try:
200+
# The bootstrap pod stays cluster-manager after the data node is Ready, and
201+
# answers 503 until its own security config loads; once it is gone, the
202+
# Ready data node is the manager. The handoff takes seconds; 3m leaves room
203+
# for several 10s retire retries, a 30s requeue and the 30s grace period.
204+
- error:
205+
timeout: 3m
206+
resource:
207+
apiVersion: v1
208+
kind: Pod
209+
metadata:
210+
name: opensearch-test-bootstrap-0
211+
# The same Initialized flag also releases any restart that became pending
212+
# during first boot, and on one replica it takes the only node down. 6m:
213+
# the health steps requeue every 10s, then the pod restarts on an image the
214+
# node already has.
215+
- assert:
216+
timeout: 6m
217+
resource:
218+
apiVersion: apps/v1
219+
kind: StatefulSet
220+
metadata:
221+
name: opensearch-test-nodes
222+
(status.observedGeneration == metadata.generation): true
223+
status:
224+
readyReplicas: 1
225+
updatedReplicas: 1
226+
(currentRevision == updateRevision): true
200227
- script:
201228
# Above the two in-pod budgets below, so one of them is what fires.
202229
timeout: 3m

0 commit comments

Comments
 (0)