Skip to content

*: migrate to factory options for test server defaults#164324

Open
Nukitt wants to merge 1 commit intocockroachdb:masterfrom
Nukitt:use-WithDRPCOption
Open

*: migrate to factory options for test server defaults#164324
Nukitt wants to merge 1 commit intocockroachdb:masterfrom
Nukitt:use-WithDRPCOption

Conversation

@Nukitt
Copy link
Contributor

@Nukitt Nukitt commented Feb 25, 2026

This change removes the deprecated TestingGlobalDRPCOption and TestingSetDefaultTenantSelectionOverride global override functions and migrates all usages to the new factory option pattern using WithDRPCOption and WithTenantOption passed to InitTestServerFactory.

This provides several benefits:

  • Options are applied at factory initialization time, not via global state
  • No need for defer/cleanup patterns

We now also have a clearer and uniform priority order for overides: test explicit > env vars > factory defaults > metamorphic

Epic: CRDB-55382
Fixes: #164250
Fixes: #164251
Release note: None

This change removes the deprecated `TestingGlobalDRPCOption` and
`TestingSetDefaultTenantSelectionOverride` global override functions
and migrates all usages to the new factory option pattern using
`WithDRPCOption` and `WithTenantOption` passed to `InitTestServerFactory`.

This provides several benefits:
- Options are applied at factory initialization time, not via global state
- No need for defer/cleanup patterns

We now also have a clearer and uniform priority order for overides:
`test explicit > env vars > factory defaults > metamorphic`

Epic: CRDB-55382
Fixes: cockroachdb#164250
Fixes: cockroachdb#164251
Release note: None
@trunk-io
Copy link
Contributor

trunk-io bot commented Feb 25, 2026

Merging to master in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

@blathers-crl
Copy link

blathers-crl bot commented Feb 25, 2026

Your pull request contains more than 1000 changes. It is strongly encouraged to split big PRs into smaller chunks.

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

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@Nukitt Nukitt marked this pull request as ready for review February 25, 2026 08:37
@Nukitt Nukitt requested review from a team as code owners February 25, 2026 08:37
@Nukitt Nukitt requested review from ZhouXing19, alyshanjahani-crl, dt and jeffswenson and removed request for a team February 25, 2026 08:37
Copy link
Collaborator

@stevendanna stevendanna left a comment

Choose a reason for hiding this comment

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

Thanks for doing this cleanup!

I didn't review every mechanical code change here. I did try to review the test_server_shim.go changes.

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

Labels

None yet

Projects

None yet

3 participants