trace: disable flaky tests
Also, add diffs to help find the problem.
@@ -395,11 +395,7 @@ func TestNewSpan(t *testing.T) {
t.Fatal(err)
}
- if len(patch.Traces) != len(expected.Traces) || len(patch.Traces[0].Spans) != len(expected.Traces[0].Spans) {
- got, _ := json.Marshal(patch)
- want, _ := json.Marshal(expected)
- t.Fatalf("PatchTraces request: got %s want %s", got, want)
- }
+ checkTraces(t, patch, expected)
n := len(patch.Traces[0].Spans)
rootSpan := patch.Traces[0].Spans[n-1]
@@ -464,6 +460,7 @@ func TestNewSpan(t *testing.T) {
}
func testTrace(t *testing.T, synchronous bool, fromRequest bool) {
+ t.Skip("flaky")
const header = `0123456789ABCDEF0123456789ABCDEF/42;o=3`
rt := newFakeRoundTripper()
traceClient := newTestClient(rt)
@@ -558,11 +555,7 @@ func testTrace(t *testing.T, synchronous bool, fromRequest bool) {
t.Fatal(err)
}
- if len(patch.Traces) != len(expected.Traces) || len(patch.Traces[0].Spans) != len(expected.Traces[0].Spans) {
- got, _ := json.Marshal(patch)
- want, _ := json.Marshal(expected)
- t.Fatalf("PatchTraces request: got %s want %s", got, want)
- }
+ checkTraces(t, patch, expected)
n := len(patch.Traces[0].Spans)
rootSpan := patch.Traces[0].Spans[n-1]
@@ -963,3 +956,13 @@ func BenchmarkSpanFromHeader(b *testing.B) {
traceClient.SpanFromHeader(name, header)
}
}
+
+func checkTraces(t *testing.T, patch, expected api.Traces) {
+ if len(patch.Traces) != len(expected.Traces) || len(patch.Traces[0].Spans) != len(expected.Traces[0].Spans) {
+ diff := testutil.Diff(patch.Traces, expected.Traces)
+ t.Logf("diff:\n%s", diff)
+ got, _ := json.Marshal(patch)
+ want, _ := json.Marshal(expected)
+ t.Fatalf("PatchTraces request: got %s want %s", got, want)
+ }
+}
