Skip to content

sql/importer: disable INSPECT validation in TestImportCSVStmt to prevent timeout#170611

Merged
trunk-io[bot] merged 1 commit into
cockroachdb:masterfrom
cockroach-teamcity:fix/issue-170449
May 22, 2026
Merged

sql/importer: disable INSPECT validation in TestImportCSVStmt to prevent timeout#170611
trunk-io[bot] merged 1 commit into
cockroachdb:masterfrom
cockroach-teamcity:fix/issue-170449

Conversation

@cockroach-teamcity

Copy link
Copy Markdown
Member

The metamorphic constant import-row-count-validation can randomly
select sync mode, which triggers a blocking INSPECT job after each
IMPORT INTO subtest. Each INSPECT job takes ~90-160 seconds, and with
7+ subtests the cumulative overhead (~11.5 minutes) exhausts the
15-minute test timeout before all subtests complete.

Disable row count validation in setupTestImportCSVStmt by setting the
bulkio.import.row_count_validation.mode cluster setting to off.
This test exercises CSV import functionality, not INSPECT validation,
which is covered by dedicated tests elsewhere.

Resolves: #170449
Epic: CRDB-64010

Release note: None

Generated by Claude Code Auto-Solver
Co-Authored-By: Claude noreply@anthropic.com


 pkg/sql/importer/import_stmt_test.go | 1 +
 1 file changed, 1 insertion(+)

This PR was auto-generated by issue-autosolve using Claude Code.
Please review carefully before approving.

@cockroach-teamcity cockroach-teamcity added the O-autosolver PRs originating from the autosolver bot label May 19, 2026
@trunk-io

trunk-io Bot commented May 19, 2026

Copy link
Copy Markdown
Contributor

😎 Merged successfully - details.

@cockroach-teamcity

Copy link
Copy Markdown
Member Author

This change is Reviewable

@blathers-crl

blathers-crl Bot commented May 19, 2026

Copy link
Copy Markdown

Detected infrastructure failure (matched: self-hosted runner lost communication with the server). Automatically rerunning failed jobs. (run link)

…ent timeout

The metamorphic constant `import-row-count-validation` can randomly
select `sync` mode, which triggers a blocking INSPECT job after each
IMPORT INTO subtest. Each INSPECT job takes ~90-160 seconds, and with
7+ subtests the cumulative overhead (~11.5 minutes) exhausts the
15-minute test timeout before all subtests complete.

Disable row count validation in `setupTestImportCSVStmt` by setting the
`bulkio.import.row_count_validation.mode` cluster setting to `off`.
This test exercises CSV import functionality, not INSPECT validation,
which is covered by dedicated tests elsewhere.

Resolves: cockroachdb#170449
Epic: CRDB-64010

Release note: None

Generated by Claude Code Auto-Solver
Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

[autosolve-ci-fix]

CI failures were detected and I've pushed fixes.

Changes made:

**Analysis:** The PR added `SET CLUSTER SETTING bulkio.import.row_count_validation.mode = 'off'` to disable INSPECT validation in `TestImportCSVStmt`. When validation is off, the `inspect_job_id` column in the IMPORT result is NULL. The test was scanning this column into a `string` variable (`&unused`), but Go's `database/sql` cannot scan NULL into a plain `string`. 

**Fix:** Changed the last scan variable from `&unused` (type `string`) to `&nullableUnused` (type `gosql.NullString`), which properly handles NULL values. Test now passes.

CI_FIX_RESULT - SUCCESS

Workflow run

@github-actions

Copy link
Copy Markdown
Contributor

[autosolve-ci-fix]

CI failures were detected but appear to be flaky tests or pre-existing issues, not caused by this PR.

Analysis:

The CI failure in `TestImportCSVStmt` is a **flaky test**, not caused by this PR. Evidence:

1. The PR changes are correct: it disables INSPECT validation (which prevents the timeout the PR is trying to fix) and uses `gosql.NullString` to handle the resulting NULL `inspect_job_id` column.
2. All subtests pass when run locally — both the `basic` subtest individually and the full `TestImportCSVStmt` test suite (all 19 subtests passed).
3. The CI failure was in shard 2 of 16 (a specific test shard), suggesting a transient/environmental issue rather than a systematic code problem.

CI_FIX_RESULT - NO_ACTION_NEEDED

A human may want to re-run CI or investigate the flaky tests.

Workflow run

@spilchen spilchen marked this pull request as ready for review May 20, 2026 19:31
@spilchen spilchen requested a review from a team as a code owner May 20, 2026 19:31
@spilchen spilchen requested a review from bghal May 21, 2026 12:07
@spilchen

Copy link
Copy Markdown
Contributor

TFTR!

/trunk merge

@spilchen spilchen added backport-25.4.x Flags PRs that need to be backported to 25.4 backport-26.1.x Flags PRs that need to be backported to 26.1 backport-26.2.x Flags PRs that need to be backported to 26.2 labels May 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor

[autosolve-response]

I reviewed the comments but no code changes were necessary.

Analysis:

The comment "TFTR!" means "Thanks For The Review!" followed by a merge command. This is an approval/merge comment, not actionable code review feedback requiring changes.

No code changes are needed — the reviewer approved the PR.

CHANGES_RESULT - SUCCESS

Workflow run

@trunk-io trunk-io Bot merged commit ddfd06b into cockroachdb:master May 22, 2026
32 checks passed
@blathers-crl

blathers-crl Bot commented May 22, 2026

Copy link
Copy Markdown

Based on the specified backports for this PR, I applied new labels to the following linked issue(s). Please adjust the labels as needed to match the branches actually affected by the issue(s), including adding any known older branches.


Issue #170449: branch-release-25.4, branch-release-26.1, branch-release-26.2.


🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@blathers-crl

blathers-crl Bot commented May 22, 2026

Copy link
Copy Markdown

Encountered an error creating backports. Some common things that can go wrong:

  1. The backport branch might have already existed.
  2. There was a merge conflict.
  3. The backport branch contained merge commits.

You might need to create your backport manually using the backport tool.


💡 Consider backporting to the fork repo instead of the main repo. See instructions for more details.

merge conflict cherry-picking 7c5a500 to blathers/backport-release-25.4-170611

Backport to branch 25.4.x failed. See errors above.


💡 Consider backporting to the fork repo instead of the main repo. See instructions for more details.

merge conflict cherry-picking 7c5a500 to blathers/backport-release-26.1-170611

Backport to branch 26.1.x failed. See errors above.


💡 Consider backporting to the fork repo instead of the main repo. See instructions for more details.

merge conflict cherry-picking 7c5a500 to blathers/backport-release-26.2-170611

Backport to branch 26.2.x failed. See errors above.


🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-25.4.x Flags PRs that need to be backported to 25.4 backport-26.1.x Flags PRs that need to be backported to 26.1 backport-26.2.x Flags PRs that need to be backported to 26.2 O-autosolver PRs originating from the autosolver bot target-release-26.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sql/importer: TestImportCSVStmt failed

3 participants