Skip to content

Commit

Permalink
fix: Add a wait for server to start before doing a curl, to avoid syn…
Browse files Browse the repository at this point in the history
…c 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 <[email protected]>
  • Loading branch information
Shubhranshu153 authored Mar 11, 2024
1 parent 13d7525 commit cb3138e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit cb3138e

Please sign in to comment.