206206# Scale requester to 0 (instance should sleep in launcher)
207207kubectl scale rs $rslb --replicas=0
208208
209- expect " kubectl get pods -o name -l app=dp-example,instance=$instlb | grep -c '^pod/' || true | grep -w 0"
210- ! kubectl get pod $reqlb
209+ expect " kubectl get pods -o name -l app=dp-example,instance=$instlb | wc -l | grep -w 0"
211210
212211# Launcher should remain
213212kubectl get pod $launcherlb
214213
215214# Verify launcher is unbound (no dual label pointing to requester)
216215expect ' [ "$(kubectl get pod $launcherlb -o jsonpath={.metadata.labels.dual-pods\\.llm-d\\.ai/dual})" == "" ]'
217216
218- sleep 5
219-
220217# Scale back up (should reuse same launcher and wake sleeping instance)
221218kubectl scale rs $rslb --replicas=1
222219
@@ -246,8 +243,7 @@ cheer Successful instance wake-up fast path
246243# Scale requester to 0 again
247244kubectl scale rs $rslb --replicas=0
248245
249- expect " kubectl get pods -o name -l app=dp-example,instance=$instlb | grep -c '^pod/' || true | grep -w 0"
250- ! kubectl get pod $reqlb2
246+ expect " kubectl get pods -o name -l app=dp-example,instance=$instlb | wc -l | grep -w 0"
251247
252248# Launcher should remain
253249kubectl get pod $launcherlb
@@ -256,9 +252,7 @@ kubectl get pod $launcherlb
256252expect ' [ "$(kubectl get pod $launcherlb -o jsonpath={.metadata.labels.dual-pods\\.llm-d\\.ai/dual})" == "" ]'
257253
258254# Patch ReplicaSet to use isc2 instead of isc
259- kubectl patch rs $rslb --type=json -p=' [{"op": "replace", "path": "/spec/template/metadata/annotations/dual-pods.llm-d.ai~1inference-server-config", "value": "' $isc2 ' "}]'
260-
261- sleep 5
255+ kubectl patch rs $rslb -p=' {"spec":{"template":{"metadata":{"annotations":{"dual-pods.llm-d.ai/inference-server-config":"' $isc2 ' "}}}}}'
262256
263257# Scale back up (should reuse same launcher and create 2nd instance)
264258kubectl scale rs $rslb --replicas=1
@@ -292,8 +286,7 @@ cheer Successful multiple instances sharing one launcher
292286# Scale requester to 0 again
293287kubectl scale rs $rslb --replicas=0
294288
295- expect " kubectl get pods -o name -l app=dp-example,instance=$instlb | grep -c '^pod/' || true | grep -w 0"
296- ! kubectl get pod $reqlb3
289+ expect " kubectl get pods -o name -l app=dp-example,instance=$instlb | wc -l | grep -w 0"
297290
298291# Launcher should remain
299292kubectl get pod $launcherlb
@@ -302,9 +295,7 @@ kubectl get pod $launcherlb
302295expect ' [ "$(kubectl get pod $launcherlb -o jsonpath={.metadata.labels.dual-pods\\.llm-d\\.ai/dual})" == "" ]'
303296
304297# Patch ReplicaSet back to use original isc
305- kubectl patch rs $rslb --type=json -p=' [{"op": "replace", "path": "/spec/template/metadata/annotations/dual-pods.llm-d.ai~1inference-server-config", "value": "' $isc ' "}]'
306-
307- sleep 5
298+ kubectl patch rs $rslb -p=' {"spec":{"template":{"metadata":{"annotations":{"dual-pods.llm-d.ai/inference-server-config":"' $isc ' "}}}}}'
308299
309300# Scale back up (should reuse same launcher and wake first instance)
310301kubectl scale rs $rslb --replicas=1
0 commit comments