From e5921f65ca334aade9bdba76f815ec2ee56956f4 Mon Sep 17 00:00:00 2001 From: Tim Burks Date: Mon, 24 Jul 2023 14:04:26 -0700 Subject: [PATCH 1/2] Increase timeout for connecting to bleve server --- cmd/registry-experimental/cmd/bleve/bleve_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/registry-experimental/cmd/bleve/bleve_test.go b/cmd/registry-experimental/cmd/bleve/bleve_test.go index ab9a957c..2d580aaf 100644 --- a/cmd/registry-experimental/cmd/bleve/bleve_test.go +++ b/cmd/registry-experimental/cmd/bleve/bleve_test.go @@ -210,7 +210,7 @@ func TestServer(t *testing.T) { }() // Wait for the server to start. - _, err := net.DialTimeout("tcp", "localhost:"+port, 2*time.Second) + _, err := net.DialTimeout("tcp", "localhost:"+port, 5*time.Second) if err != nil { log.Fatalf("Failed to connect to test server: %s", err) } From 171e957797d0610ec544e619ad43a69c7339189f Mon Sep 17 00:00:00 2001 From: Tim Burks Date: Mon, 24 Jul 2023 14:15:59 -0700 Subject: [PATCH 2/2] sleep before calling the server --- cmd/registry-experimental/cmd/bleve/bleve_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/registry-experimental/cmd/bleve/bleve_test.go b/cmd/registry-experimental/cmd/bleve/bleve_test.go index 2d580aaf..0e8181b7 100644 --- a/cmd/registry-experimental/cmd/bleve/bleve_test.go +++ b/cmd/registry-experimental/cmd/bleve/bleve_test.go @@ -210,7 +210,8 @@ func TestServer(t *testing.T) { }() // Wait for the server to start. - _, err := net.DialTimeout("tcp", "localhost:"+port, 5*time.Second) + time.Sleep(1 * time.Second) // arbitrary pause + _, err := net.DialTimeout("tcp", "localhost:"+port, 2*time.Second) if err != nil { log.Fatalf("Failed to connect to test server: %s", err) }