-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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: increase tenant testing coverage #142391
sql: increase tenant testing coverage #142391
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you! i had one nit.
Reviewable status:
complete! 0 of 0 LGTMs obtained
pkg/sql/mvcc_backfiller_test.go
line 597 at r4 (raw file):
defer s.Stopper().Stop(context.Background()) codec := s.ApplicationLayer().Codec() scratch = append(s.Codec().TenantPrefix(), roachpb.Key("scratch")...)
i don't think roachpb.Key("scratch")
is correct here. does this work:
var err error
scratch, err = s.ScratchRange()
require.NoError(t, err)
scratch = append(s.Codec().TenantPrefix(), scratch...)
c370cdd
to
bf124c9
Compare
Previously, rafiss (Rafi Shamim) wrote…
Thanks for pointing this out. The suggested approach seems much better. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR increases tenant testing coverage for SQL components by switching test server parameter creation to allow tenants in several tests. Key changes include:
- Replacing createTestServerParams with createTestServerParamsAllowTenants in multiple test files, ensuring tenant support.
- Adjusting test expectations based on the server’s deployment mode (external vs. shared-process).
- Introducing new helper functions in test_server_args.go to manage external process mode behavior.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
pkg/sql/jobs_profiler_execution_details_test.go | Updates tests for job profiler execution details to use tenant-enabled server parameters and conditionally check outputs based on deployment mode. |
pkg/base/test_server_args.go | Adds functions to flag tests as skipped or non-functional in external process mode for performance reasons. |
pkg/sql/txn_restart_test.go | Updates various txn restart tests to use tenant-enabled parameters and modernizes PG URL generation approach. |
pkg/sql/unsplit_range_test.go | Adjusts unsplit range test configuration to run with tenant-enabled defaults and skips external mode tests where applicable. |
pkg/sql/mvcc_backfiller_test.go | Enables tenant support in MVCC backfiller tests and prefixes the scratch range with a tenant prefix to simulate multi-tenant behavior. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm! i did not review pkg/sql/jobs_profiler_execution_details_test.go
Reviewable status:
complete! 0 of 0 LGTMs obtained
I opened issue cockroachdb#142388 to track the work for enabling external-process mode testing, as it turned out to be a non-trivial effort.
bf124c9
to
7c40dd2
Compare
TFTRs! bors r=rafiss,msbutler |
In cockroachdb#142391, a bug was introduced in the test where `testutils.SucceedSoon`'s closure used `require.Len` instead of returning an error, causing the test to fail if slice length doesn't match without retrying. This assertion has been reverted to the `if` statement that returns an error instead. Fixes: cockroachdb#143082 Release note: none Epic: none
143113: sql: fix TestListProfilerExecutionDetails r=yuzefovich a=shubhamdhama In #142391, a bug was introduced in the test where `testutils.SucceedSoon`'s closure used `require.Len` instead of returning an error, causing the test to fail if slice length doesn't match without retrying. This assertion has been reverted to the `if` statement that returns an error instead. Fixes: #143082 Release note: none Epic: none Co-authored-by: Shubham Dhama <[email protected]>
sql: increase tenant testing coverage for `jobs_profiler_execution_details_test`
sql: increase tenant testing coverage for `mvcc_backfiller_test`
sql: increase tenant testing coverage for `txn_restart_test`
sql: enable shared-process mode tenant testing for `TestUnsplitRanges`
I opened issue #142388 to track the work for enabling external-process mode
testing, as it turned out to be a non-trivial effort.
Informs: #140446
Epic: CRDB-48564
Release note: None