Skip to content

sql: unskip TestWriteResumeSpan, TestDropDatabaseDeleteData, TestAbortedTxnLocks, and TestBackfillQueryWithProtectedTS for mulitenant#160528

Merged
craig[bot] merged 4 commits intocockroachdb:masterfrom
rafiss:mt-TestWriteResumeSpan
Jan 6, 2026
Merged

sql: unskip TestWriteResumeSpan, TestDropDatabaseDeleteData, TestAbortedTxnLocks, and TestBackfillQueryWithProtectedTS for mulitenant#160528
craig[bot] merged 4 commits intocockroachdb:masterfrom
rafiss:mt-TestWriteResumeSpan

Conversation

@rafiss
Copy link
Copy Markdown
Collaborator

@rafiss rafiss commented Jan 6, 2026

rowexec: fix TestWriteResumeSpan to work with external test tenants #160528

Previously, TestWriteResumeSpan used raw key literals like roachpb.Key("a") without tenant prefixes.

This commit adds a makeKey helper function that prepends the tenant prefix to keys, following the same pattern already used in TestResumeSpanSSTManifestRoundTrip.

sql: fix TestDropDatabaseDeleteData to work with external test tenants

The test was failing with a "sync: negative WaitGroup counter" panic
when running with COCKROACH_TEST_TENANT=true. This happened because the
OnWatchForZoneConfigUpdatesEstablished callback was being invoked
multiple times (once for the system tenant and once for the test
tenant), causing zoneCfgRangeFeedStarted.Done() to be called more than
once on a WaitGroup that only had Add(1).

The fix uses sync.Once to ensure Done() is only called once, regardless
of how many times the callback is invoked.

sql: unskip TestAbortedTxnLocks for tenants

This passed without any other changes.

sql: fix TestBackfillQueryWithProtectedTS to work with external test tenants

The test was failing with tenants because crdb_internal.kv_enqueue_replica
is not supported in virtual clusters. The fix queries range IDs from the
tenant connection (since the table is in the tenant), then executes
kv_enqueue_replica through the system layer connection, matching the
pattern already used in TestValidationWithProtectedTS in the same file.

fixes #156127
Release note: None

Previously, TestWriteResumeSpan used raw key literals like
roachpb.Key("a") without tenant prefixes.

This commit adds a makeKey helper function that prepends the tenant
prefix to keys, following the same pattern already used in
TestResumeSpanSSTManifestRoundTrip.

Part of: cockroachdb#156127

Release note: None
@rafiss rafiss requested a review from a team as a code owner January 6, 2026 05:20
@rafiss rafiss requested review from michae2 and removed request for a team January 6, 2026 05:20
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

rafiss added 3 commits January 6, 2026 00:27
The test was failing with a "sync: negative WaitGroup counter" panic
when running with COCKROACH_TEST_TENANT=true. This happened because the
OnWatchForZoneConfigUpdatesEstablished callback was being invoked
multiple times (once for the system tenant and once for the test
tenant), causing zoneCfgRangeFeedStarted.Done() to be called more than
once on a WaitGroup that only had Add(1).

The fix uses sync.Once to ensure Done() is only called once, regardless
of how many times the callback is invoked.

part of: cockroachdb#156127

Release note: None
This passed without any other changes.

Release note: None
…tenants

The test was failing with tenants because `crdb_internal.kv_enqueue_replica`
is not supported in virtual clusters. The fix queries range IDs from the
tenant connection (since the table is in the tenant), then executes
`kv_enqueue_replica` through the system layer connection, matching the
pattern already used in `TestValidationWithProtectedTS` in the same file.

Informs: cockroachdb#156127

Release note: None
@rafiss rafiss requested a review from a team as a code owner January 6, 2026 15:41
@rafiss rafiss changed the title rowexec: fix TestWriteResumeSpan to work with external test tenants sql: unskip TestWriteResumeSpan, TestDropDatabaseDeleteData, TestAbortedTxnLocks, and TestBackfillQueryWithProtectedTS for mulitenant Jan 6, 2026
@rafiss rafiss requested a review from fqazi January 6, 2026 15:43
Copy link
Copy Markdown
Collaborator

@fqazi fqazi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm: @rafiss Nice work!

@fqazi reviewed 4 files and all commit messages, and made 1 comment.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @michae2).

@rafiss
Copy link
Copy Markdown
Collaborator Author

rafiss commented Jan 6, 2026

bors r+

@craig craig bot merged commit f50ee9d into cockroachdb:master Jan 6, 2026
26 of 28 checks passed
@craig
Copy link
Copy Markdown
Contributor

craig bot commented Jan 6, 2026

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sql-foundations: investigate skipped tests under test tenant

3 participants