From cb3138e72fe7284e2c27a34859ce22e24ae440e9 Mon Sep 17 00:00:00 2001 From: Subhransu <47723536+Shubhranshu153@users.noreply.github.com> Date: Mon, 11 Mar 2024 15:55:41 -0700 Subject: [PATCH] fix: Add a wait for server to start before doing a curl, to avoid sync issue (#124) Issue #, if available: *Description of changes:* Add a wait for server to start before doing a curl, to avoid sync issue *Testing done:* - [ ] I've reviewed the guidance in CONTRIBUTING.md #### License Acceptance By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. Signed-off-by: Shubharanshu Mahapatra --- tests/run.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/run.go b/tests/run.go index e511ad7..85b52fc 100644 --- a/tests/run.go +++ b/tests/run.go @@ -342,6 +342,8 @@ func Run(o *RunOption) { hostPort := fnet.GetFreePort() s := http.Server{Addr: fmt.Sprintf(":%d", hostPort), Handler: mux, ReadTimeout: 30 * time.Second} go s.ListenAndServe() //nolint:errcheck // Asynchronously starting server for testing only. + + time.Sleep(5 * time.Second) ginkgo.DeferCleanup(s.Shutdown, ctx) command.Run(o.BaseOpt, "run", "-d", "--name", testContainerName, "--add-host", "test-host:host-gateway", amazonLinux2Image, "sleep", "infinity")