@@ -50,12 +50,10 @@ import (
5050 "github.com/elastic/apm-server/systemtest/apmservertest"
5151 "github.com/elastic/apm-server/systemtest/estest"
5252 "github.com/elastic/go-elasticsearch/v8"
53- "github.com/elastic/go-elasticsearch/v8/esapi"
5453)
5554
5655const (
5756 startContainersTimeout = 5 * time .Minute
58- waitHealthyInterval = 5 * time .Second
5957)
6058
6159var (
@@ -112,7 +110,6 @@ func StartStackContainers() error {
112110 g , ctx := errgroup .WithContext (ctx )
113111 g .Go (func () error { return waitContainerHealthy (ctx , "kibana" ) })
114112 g .Go (func () error { return waitContainerHealthy (ctx , "fleet-server" ) })
115- g .Go (func () error { return waitGeoIPDatabase (ctx ) })
116113 return g .Wait ()
117114}
118115
@@ -194,51 +191,11 @@ func waitContainerHealthy(ctx context.Context, serviceName string) error {
194191 log .Printf ("Waiting for %s container (%s) to become healthy" , serviceName , container .ID )
195192 first = false
196193 }
197- time .Sleep (waitHealthyInterval )
194+ time .Sleep (5 * time . Second )
198195 }
199196 return nil
200197}
201198
202- // Elasticsearch downloads the geoIP database after starting up, and then refreshes it
203- // periodically. In CI the cluster will be fresh, so we wait for the database to be
204- // downloaded before running any tests which may depend on it being available.
205- func waitGeoIPDatabase (ctx context.Context ) error {
206- type geoIPDatabase struct {
207- Name string
208- }
209- type nodeGeoIPStats struct {
210- Databases []geoIPDatabase
211- }
212-
213- first := true
214- for {
215- var out struct {
216- Nodes map [string ]nodeGeoIPStats
217- }
218- _ , err := Elasticsearch .Do (ctx , esapi.IngestGeoIPStatsRequest {}, & out )
219- if err != nil {
220- return err
221- }
222-
223- if n := len (out .Nodes ); n != 1 {
224- return fmt .Errorf ("expected 1 node, got %d" , n )
225- }
226- for _ , nodeStats := range out .Nodes {
227- for _ , db := range nodeStats .Databases {
228- if db .Name == "GeoLite2-City.mmdb" {
229- return nil
230- }
231- }
232- }
233-
234- if first {
235- log .Printf ("Waiting for geoIP database to be downloaded" )
236- first = false
237- }
238- time .Sleep (waitHealthyInterval )
239- }
240- }
241-
242199func stackContainerInfo (ctx context.Context , docker * client.Client , name string ) (* types.Container , error ) {
243200 containers , err := docker .ContainerList (ctx , types.ContainerListOptions {
244201 Filters : filters .NewArgs (
0 commit comments