diff --git a/pkg/sql/crdb_internal_test.go b/pkg/sql/crdb_internal_test.go index 07889983faf4..3966e3ed6d80 100644 --- a/pkg/sql/crdb_internal_test.go +++ b/pkg/sql/crdb_internal_test.go @@ -41,7 +41,6 @@ import ( "github.com/cockroachdb/cockroach/pkg/sql/tests" "github.com/cockroachdb/cockroach/pkg/testutils" "github.com/cockroachdb/cockroach/pkg/testutils/serverutils" - "github.com/cockroachdb/cockroach/pkg/testutils/skip" "github.com/cockroachdb/cockroach/pkg/testutils/sqlutils" "github.com/cockroachdb/cockroach/pkg/testutils/testcluster" "github.com/cockroachdb/cockroach/pkg/util/ctxgroup" @@ -517,7 +516,6 @@ UPDATE system.namespace SET id = 12345 WHERE id = %d; func TestDistSQLFlowsVirtualTables(t *testing.T) { defer leaktest.AfterTest(t)() - skip.UnderRaceWithIssue(t, 75208, "flaky test under race") defer log.Scope(t).Close(t) const numNodes = 3 @@ -686,8 +684,18 @@ func TestDistSQLFlowsVirtualTables(t *testing.T) { if maxRunningFlows == 1 { expRunning, expQueued = expQueued, expRunning } - if getNum(db, clusterScope, runningStatus) != expRunning || getNum(db, clusterScope, queuedStatus) != expQueued { - t.Fatalf("unexpected output from cluster_distsql_flows on node %d", nodeID+1) + gotRunning, gotQueued := getNum(db, clusterScope, runningStatus), getNum(db, clusterScope, queuedStatus) + if gotRunning != expRunning { + t.Fatalf("unexpected output from cluster_distsql_flows on node %d (running=%d)", nodeID+1, gotRunning) + } + if maxRunningFlows == 1 { + if gotQueued != expQueued { + t.Fatalf("unexpected output from cluster_distsql_flows on node %d (queued=%d)", nodeID+1, gotQueued) + } + } else { + if gotQueued > expQueued { // it's possible for the query to have already errored out + t.Fatalf("unexpected output from cluster_distsql_flows on node %d (queued=%d)", nodeID+1, gotQueued) + } } // Check node level table. @@ -700,8 +708,18 @@ func TestDistSQLFlowsVirtualTables(t *testing.T) { if maxRunningFlows == 1 { expRunning, expQueued = expQueued, expRunning } - if getNum(db, nodeScope, runningStatus) != expRunning || getNum(db, nodeScope, queuedStatus) != expQueued { - t.Fatalf("unexpected output from node_distsql_flows on node %d", nodeID+1) + gotRunning, gotQueued = getNum(db, nodeScope, runningStatus), getNum(db, nodeScope, queuedStatus) + if gotRunning != expRunning { + t.Fatalf("unexpected output from node_distsql_flows on node %d (running=%d)", nodeID+1, gotRunning) + } + if maxRunningFlows == 1 { + if gotQueued != expQueued { + t.Fatalf("unexpected output from node_distsql_flows on node %d (queued=%d)", nodeID+1, gotQueued) + } + } else { + if gotQueued > expQueued { // it's possible for the query to have already errored out + t.Fatalf("unexpected output from node_distsql_flows on node %d (queued=%d)", nodeID+1, gotQueued) + } } } }