Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
belimawr committed Sep 30, 2024
1 parent b7b49b6 commit f76aeed
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions libbeat/outputs/elasticsearch/client_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -429,8 +429,12 @@ func connectTestEs(t *testing.T, cfg interface{}, stats outputs.Observer) (outpu
}
client := randomClient(output).(clientWrap).Client().(*Client)

// Load version number
_ = client.Connect()
// Load version ctx
ctx, cancel := context.WithCancel(context.Background())
t.Cleanup(cancel)
if err := client.Connect(ctx); err != nil {
t.Fatalf("cannot connect to ES: %s", err)
}

return client, client
}
Expand Down

0 comments on commit f76aeed

Please sign in to comment.