Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sql: attempt to deflake distsql physical planner tests #31239

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions pkg/sql/distsql_physical_planner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,12 @@ func TestDistSQLRangeCachesIntegrationTest(t *testing.T) {
t.Fatal(err)
}

// Ensure that the range cache is populated (see #31235).
_, err = db0.Exec(`SHOW EXPERIMENTAL_RANGES FROM TABLE "right"`)
if err != nil {
t.Fatal(err)
}

// Run everything in a transaction, so we're bound on a connection on which we
// force DistSQL.
txn, err := db3.BeginTx(context.TODO(), nil /* opts */)
Expand Down Expand Up @@ -419,6 +425,8 @@ func TestDistSQLDeadHosts(t *testing.T) {
))
}

r.Exec(t, "SHOW EXPERIMENTAL_RANGES FROM TABLE t")

r.Exec(t, fmt.Sprintf("INSERT INTO t SELECT i, i*i FROM generate_series(1, %d) AS g(i)", n))

r.Exec(t, "SET DISTSQL = ON")
Expand Down Expand Up @@ -507,6 +515,9 @@ func TestDistSQLDrainingHosts(t *testing.T) {
),
)

// Ensure that the range cache is populated (see #31235).
r.Exec(t, "SHOW EXPERIMENTAL_RANGES FROM TABLE nums")

const query = "SELECT count(*) FROM NUMS"
expectPlan := func(expectedPlan [][]string) {
planQuery := fmt.Sprintf(`SELECT url FROM [EXPLAIN (DISTSQL) %s]`, query)
Expand Down