From dd5dadfc62bb2233a179562cc232d111160faf50 Mon Sep 17 00:00:00 2001 From: CircleCI Agent Date: Wed, 6 Aug 2025 13:46:29 +0000 Subject: [PATCH] Fix flaky test: TestO11y/http_with_token --- o11y/otel/otel_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/o11y/otel/otel_test.go b/o11y/otel/otel_test.go index 78770e331..ddba606bc 100644 --- a/o11y/otel/otel_test.go +++ b/o11y/otel/otel_test.go @@ -130,6 +130,16 @@ func TestO11y(t *testing.T) { t.Run("find trace", func(t *testing.T) { jc := jaeger.New("http://localhost:16686", tt.cfg.Service) + poll.WaitOn(t, func(t poll.LogT) poll.Result { + traces, err := jc.Traces(ctx, start) + if err != nil { + return poll.Error(err) + } + if len(traces) >= 1 { + return poll.Success() + } + return poll.Continue("only got %d traces", len(traces)) + }) traces, err := jc.Traces(ctx, start) assert.NilError(t, err) assert.Assert(t, cmp.Len(traces, 1))