Skip to content

Commit

Permalink
Increase trace test timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
joaopgrassi committed Apr 29, 2024
1 parent 13aab29 commit 9b52bef
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions internal/common/testutils/trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ func GetTraceWithRetry(t *testing.T, serviceName string) *otlptrace.ResourceSpan
1 * time.Second,
3 * time.Second,
10 * time.Second,
15 * time.Second,
20 * time.Second,
30 * time.Second,
}

var rs *otlptrace.ResourceSpans
Expand All @@ -70,6 +73,10 @@ func GetTraceWithRetry(t *testing.T, serviceName string) *otlptrace.ResourceSpan
time.Sleep(backoff)
}

if len(rs.ScopeSpans) == 0 {
t.Fatalf("Could not find traces for sample: %s", serviceName)
}

return rs
}

Expand All @@ -82,8 +89,6 @@ func GetTrace(t *testing.T, serviceName string) *otlptrace.ResourceSpans {

t.Log("Received 200 response from OTLP backend")

defer r.Body.Close()

body, err := io.ReadAll(r.Body)
defer r.Body.Close()
if err != nil {
Expand Down

0 comments on commit 9b52bef

Please sign in to comment.