Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: cockroachdb/cockroach
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 6aa3eb692dfe25eeccce681e6e66883498dce7e0
Choose a base ref
..
head repository: cockroachdb/cockroach
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: c7641af41e3b9e80a29ece6f11c5362c28102f48
Choose a head ref
Showing with 11 additions and 6 deletions.
  1. +11 −6 pkg/sql/trace_test.go
17 changes: 11 additions & 6 deletions pkg/sql/trace_test.go
Original file line number Diff line number Diff line change
@@ -46,7 +46,7 @@ func TestTrace(t *testing.T) {
alwaysOptionalSpans := []string{
"drain",
"pendingLeaseRequest: requesting lease",
"storage.Store: gossip on capacity change",
"gossip on capacity change",
"outbox",
"request range lease",
"range lookup",
@@ -364,17 +364,22 @@ func TestTrace(t *testing.T) {
}
defer rows.Close()

ignoreSpans := make(map[string]bool)
for _, s := range test.optionalSpans {
ignoreSpans[s] = true
ignoreSpan := func(op string) bool {
for _, s := range test.optionalSpans {
if strings.Contains(op, s) {
return true
}
}
return false
}

r := 0
for rows.Next() {
var op string
if err := rows.Scan(&op); err != nil {
t.Fatal(err)
}
if ignoreSpans[op] {
if ignoreSpan(op) {
continue
}

@@ -391,7 +396,7 @@ func TestTrace(t *testing.T) {
if err := rows.Scan(&op); err != nil {
t.Fatal(err)
}
if ignoreSpans[op] {
if ignoreSpan(op) {
continue
}
t.Errorf("remaining span: %q", op)