Skip to content

ua: remove usage of tenant 2 as an application tenant from tests #151327

@Nukitt

Description

@Nukitt

Part of #136667

There are around 31 usages of roachpb.MustMakeTenantID(2) in tests used for application tenant. We should be replacing them with tenant 3 or any other relevant id number. This would align with real world scenario where tenant with id 2 doesn't exist currently, which is enforced in demo cluster and normal operations as seen here:

// ID 2 is reserved for future use: it was a "template" tenant in 23.2 UA and
// used for an internal test in serverless, so we can reclaim it if we want it
// so long as we don't allow it to be used for real tenants.
if nextID == 2 {
nextID = 3
}

When and if a cluster goes through UA migration, tenant 2 would be reserved as a system tenant.

Now, while this migration is necessary to better reflect our production environment, we need to address the following concerns to ensure our test coverage remains robust:

Boundary Testing of Keyspace Prefixes: Some of our existing tests may be implicitly testing the boundary conditions between the system tenant keyspace and the application tenant keyspace. We need to identify these tests and ensure that they continue to provide the same level of coverage after the migration to tenant ID 3. This may require refactoring the tests to explicitly target these boundary conditions.

Preserving Tenant-Specific Test Coverage: We should keep in mind that we do not lose any test coverage that was specifically designed for tenant 2. We need to carefully analyze the existing tests that use roachpb.MustMakeTenantID(2) and ensure that the scenarios they cover are either migrated to the new tenant ID or replaced with equivalent tests.

Jira issue: CRDB-53184

Sub-issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)T-db-server

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions