Skip to content

Commit

Permalink
Merge pull request #104093 from cockroachdb/blathers/backport-release…
Browse files Browse the repository at this point in the history
…-22.2-101866

release-22.2: sql/stats: remove timeout from TestAtMostOneRunningCreateStats
  • Loading branch information
DrewKimball authored Jun 1, 2023
2 parents 3369f92 + c51b5b6 commit 645cfb2
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions pkg/sql/stats/create_stats_job_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,19 +164,10 @@ func TestAtMostOneRunningCreateStats(t *testing.T) {
}

autoStatsRunShouldFail := func() {
expectErrCh := make(chan error, 1)
go func() {
_, err := conn.Exec(`CREATE STATISTICS __auto__ FROM d.t`)
expectErrCh <- err
}()
select {
case err := <-expectErrCh:
expected := "another CREATE STATISTICS job is already running"
if !testutils.IsError(err, expected) {
t.Fatalf("expected '%s' error, but got %v", expected, err)
}
case <-time.After(time.Second):
panic("CREATE STATISTICS job which was expected to fail, timed out instead")
_, err := conn.Exec(`CREATE STATISTICS __auto__ FROM d.t`)
expected := "another CREATE STATISTICS job is already running"
if !testutils.IsError(err, expected) {
t.Fatalf("expected '%s' error, but got %v", expected, err)
}
}

Expand Down

0 comments on commit 645cfb2

Please sign in to comment.