From 6e6ae389638dff364007f9319c10fe7c12451e10 Mon Sep 17 00:00:00 2001 From: Saw-jan Date: Thu, 21 Sep 2023 12:33:12 +0545 Subject: [PATCH] ociswrapper: mark server ready if the server sends any response --- tests/ociswrapper/ocis/ocis.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/ociswrapper/ocis/ocis.go b/tests/ociswrapper/ocis/ocis.go index 8f3648616b..459445abf5 100644 --- a/tests/ociswrapper/ocis/ocis.go +++ b/tests/ociswrapper/ocis/ocis.go @@ -124,7 +124,11 @@ func WaitForConnection() bool { req.Header.Set("X-Request-ID", "ociswrapper-"+strconv.Itoa(int(time.Now().UnixMilli()))) res, err := client.Do(req) - if err != nil || res.StatusCode != 200 { + if err != nil || res.StatusCode >= 400 { + if res != nil { + log.Println(fmt.Sprintf("oCIS server up but request failed: %v", res.StatusCode)) + return true + } // 500 milliseconds poll interval time.Sleep(500 * time.Millisecond) continue