MCPcopy
hub / github.com/grafana/tempo / waitForTraceInLiveStore

Function waitForTraceInLiveStore

integration/operations/livestore_test.go:303–324  ·  view source on GitHub ↗
(t *testing.T, expectedTraces int, liveStores ...*e2e.HTTPService)

Source from the content-addressed store, hash-verified

301}
302
303func waitForTraceInLiveStore(t *testing.T, expectedTraces int, liveStores ...*e2e.HTTPService) *e2e.HTTPService {
304 ch := make(chan *e2e.HTTPService)
305 timeout := 30 * time.Second
306
307 for _, liveStore := range liveStores {
308 go func(liveStore *e2e.HTTPService) {
309 err := liveStore.WaitSumMetrics(e2e.GreaterOrEqual(float64(expectedTraces)), "tempo_live_store_traces_created_total")
310 if err == nil {
311 ch <- liveStore
312 }
313 }(liveStore)
314 }
315
316 select {
317 case liveStore := <-ch:
318 close(ch)
319 return liveStore
320 case <-time.After(timeout):
321 t.Fatalf("timeout waiting for trace in live-store after %s", timeout)
322 }
323 return nil
324}
325
326func waitActivePartitions(t *testing.T, service *e2e.HTTPService, count int) {
327 matchers := []*labels.Matcher{

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected