Skip to content

Commit 69ba2e8

Browse files
committed
Use shutdown_timeout=1
Signed-off-by: Revital Sur <eres@il.ibm.com>
1 parent 1c7ebbb commit 69ba2e8

3 files changed

Lines changed: 21 additions & 21 deletions

File tree

test/coordinator/e2e/coordinator/configs_test.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ server:
2323
listen_addr: ":8080"
2424
read_timeout: 30s
2525
write_timeout: 120s
26-
shutdown_timeout: 25s
26+
# Recreated per spec behind a suite-lived Envoy; drain fast so a deleted
27+
# coordinator stops serving immediately instead of lingering on a stale
28+
# endpoint the gateway may still route to. 0s is avoided: it makes the
29+
# server Shutdown context expire instantly and the process exit non-zero.
30+
shutdown_timeout: 1s
2731
2832
gateway:
2933
address: "http://envoy.${NAMESPACE}.svc:8081"

test/coordinator/e2e/coordinator/coordinator_test.go

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,7 @@ import (
3131
testutils "github.com/llm-d/llm-d-router/test/utils"
3232
)
3333

34-
const (
35-
// requestTimeout bounds text-only chat completions (prefill, decode).
36-
requestTimeout = 60 * time.Second
37-
// multimodalRequestTimeout bounds multimodal chat completions, which add the
38-
// replace-media-urls, render, and encode stages: each image is fetched (e.g.
39-
// from S3) and run through the encoder, so the round-trip runs well past the
40-
// text-only budget. 600s matches the default client request timeout vLLM
41-
// applies to its multimodal and chat-completion serving tests.
42-
multimodalRequestTimeout = 600 * time.Second
43-
)
34+
const requestTimeout = 60 * time.Second
4435

4536
// testImageURL and testImageURL2 are publicly accessible images used to
4637
// exercise multimodal requests that trigger the encode stage.
@@ -177,11 +168,7 @@ func runCoordinatorPipeline(body []byte, expectedSteps []string, expectedImages
177168
gomega.Expect(err).ShouldNot(gomega.HaveOccurred())
178169
req.Header.Set("Content-Type", "application/json")
179170

180-
timeout := requestTimeout
181-
if expectedImages > 0 {
182-
timeout = multimodalRequestTimeout
183-
}
184-
client := &http.Client{Timeout: timeout}
171+
client := &http.Client{Timeout: requestTimeout}
185172
resp, err := client.Do(req)
186173
gomega.Expect(err).ShouldNot(gomega.HaveOccurred())
187174
defer resp.Body.Close()

test/coordinator/e2e/coordinator/setup_test.go

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -187,14 +187,23 @@ func createCoordinator(config string) []string {
187187
return objects
188188
}
189189

190-
// waitForCoordinatorReady polls /readyz through Envoy until it returns 200,
191-
// catching Envoy's STRICT_DNS resolution lagging behind the per-test Service
192-
// (podsInDeploymentsReady already confirms the coordinator pod itself is ready).
190+
// waitForCoordinatorReady polls /readyz through Envoy and requires several
191+
// consecutive successes: right after the per-spec coordinator is recreated, a
192+
// single probe can succeed while Envoy is still converging on the new endpoint,
193+
// so the next request would hit a stale one and hang.
193194
func waitForCoordinatorReady() {
194195
ginkgo.By("Waiting for coordinator to be reachable via gateway")
196+
const requiredConsecutive = 3
197+
consecutive := 0
195198
gomega.Eventually(func() bool {
196-
return pollReady(gatewayBaseURL() + "/readyz")
197-
}, readyTimeout, defaultInterval).Should(gomega.BeTrue(), "coordinator should be reachable via gateway within the ready timeout")
199+
if !pollReady(gatewayBaseURL() + "/readyz") {
200+
consecutive = 0
201+
return false
202+
}
203+
consecutive++
204+
return consecutive >= requiredConsecutive
205+
}, readyTimeout, defaultInterval).Should(gomega.BeTrue(),
206+
"coordinator should be reachable via gateway within the ready timeout")
198207
}
199208

200209
// pollReady reports whether a GET on url returns HTTP 200 within the client timeout.

0 commit comments

Comments
 (0)