Skip to content

Commit

Permalink
importccl: fix flaky test TestImportCSVStmt
Browse files Browse the repository at this point in the history
TestImportCSVStmt tests that IMPORT jobs appear in a certain order
in the system.jobs table. Automatic statistics were causing this
test to be flaky since CreateStats jobs were present in the jobs
table as well, in an unpredictable order. This commit fixes the problem
by only selecting IMPORT jobs from the jobs table.

Fixes cockroachdb#34568

Release note: None
  • Loading branch information
rytaft committed Feb 5, 2019
1 parent fc72c94 commit d39529f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 0 additions & 1 deletion pkg/ccl/importccl/import_stmt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,6 @@ func TestImportCSVStmt(t *testing.T) {
if testing.Short() {
t.Skip("short")
}
t.Skip(`#34568`)

const (
nodes = 3
Expand Down
3 changes: 2 additions & 1 deletion pkg/testutils/jobutils/jobs_verification.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ func verifySystemJob(
// the job ID.
db.QueryRow(t, `
SELECT job_type, description, user_name, descriptor_ids, status, running_status
FROM crdb_internal.jobs ORDER BY created LIMIT 1 OFFSET $1`,
FROM crdb_internal.jobs WHERE job_type = $1 ORDER BY created LIMIT 1 OFFSET $2`,
expectedType.String(),
offset,
).Scan(
&actualType, &actual.Description, &actual.Username, &rawDescriptorIDs,
Expand Down

0 comments on commit d39529f

Please sign in to comment.