| 385 | } |
| 386 | |
| 387 | func (h *TempoHarness) WaitTracesQueryable(t *testing.T, traces int) { |
| 388 | t.Helper() |
| 389 | |
| 390 | liveStoreZoneA := h.Services[ServiceLiveStoreZoneA] |
| 391 | require.NoError(t, liveStoreZoneA.WaitSumMetricsWithOptions(e2e.GreaterOrEqual(float64(traces)), []string{"tempo_live_store_traces_created_total"}, e2e.WaitMissingMetrics)) |
| 392 | |
| 393 | liveStoreZoneB := h.Services[ServiceLiveStoreZoneB] |
| 394 | require.NoError(t, liveStoreZoneB.WaitSumMetricsWithOptions(e2e.GreaterOrEqual(float64(traces)), []string{"tempo_live_store_traces_created_total"}, e2e.WaitMissingMetrics)) |
| 395 | |
| 396 | // Honor query_end_cutoff: the frontend clamps each request's `end` to `now - cutoff`, |
| 397 | // so a trace written at time T is not queryable until T + cutoff. Wait for that window |
| 398 | // to elapse since the most recent write before letting the test assert queryability. |
| 399 | h.waitForQueryEndCutoff(t) |
| 400 | } |
| 401 | |
| 402 | // waitForQueryEndCutoff sleeps until enough wall-clock time has passed since the last |
| 403 | // recorded write for traces to fall inside the queryable window defined by |