Skip to content

Commit

Permalink
chore: fix flaky test (#380)
Browse files Browse the repository at this point in the history
Fixes #379
Fixes #369
  • Loading branch information
enocom committed Jul 5, 2023
1 parent cdde914 commit bdfb882
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions internal/proxy/proxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -692,20 +692,11 @@ func TestRunConnectionCheck(t *testing.T) {
if err != nil {
t.Fatalf("proxy.NewClient error: %v", err)
}
defer func(c *proxy.Client) {
err := c.Close()
if err != nil {
t.Log(err)
}
}(c)
go func() {
// Serve alone without any connections will still verify that the
// provided instances are reachable.
err := c.Serve(context.Background(), func() {})
if err != nil {
t.Log(err)
}
}()
defer c.Close()

// Serve alone without any connections will still verify that the
// provided instances are reachable.
go c.Serve(context.Background(), func() {})

verifyDialAttempts := func() error {
var tries int
Expand All @@ -724,5 +715,4 @@ func TestRunConnectionCheck(t *testing.T) {
if err := verifyDialAttempts(); err != nil {
t.Fatal(err)
}

}

0 comments on commit bdfb882

Please sign in to comment.