From 4fb5e5a154c8daba1785b6553095460d03377c16 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Tue, 20 Oct 2026 05:17:33 -0700 Subject: [PATCH] test: honor Retry-After in cold-start assign retry Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- test/master_cold_start/assign_test.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/master_cold_start/assign_test.go b/test/master_cold_start/assign_test.go index 04a03a63c3..9ca17294e5 100644 --- a/test/master_cold_start/assign_test.go +++ b/test/master_cold_start/assign_test.go @@ -8,6 +8,7 @@ import ( "io" "mime/multipart" "net/http" + "strconv" "testing" "time" @@ -44,7 +45,11 @@ func TestColdStartFirstWrite(t *testing.T) { body, _ := io.ReadAll(resp.Body) resp.Body.Close() if resp.StatusCode == http.StatusServiceUnavailable && time.Now().Before(deadline) { - time.Sleep(time.Second) + delay, _ := strconv.Atoi(resp.Header.Get("Retry-After")) + if delay <= 0 { + t.Fatalf("dir/assign shed without a usable Retry-After: %d %s", resp.StatusCode, body) + } + time.Sleep(time.Duration(delay) * time.Second) continue } if resp.StatusCode != http.StatusOK {