-
Notifications
You must be signed in to change notification settings - Fork 4.1k
sql: make TestDropFunction work with test tenant #107322
Copy link
Copy link
Closed
Labels
A-multitenancyRelated to multi-tenancyRelated to multi-tenancyC-cleanupTech debt, refactors, loose ends, etc. Solution not expected to significantly change behavior.Tech debt, refactors, loose ends, etc. Solution not expected to significantly change behavior.T-sql-foundationsSQL Foundations Team (formerly SQL Schema + SQL Sessions)SQL Foundations Team (formerly SQL Schema + SQL Sessions)db-cy-23target-release-26.2.0v26.2.0-prerelease
Description
Currently, TestDropFunction hard-codes IDs as if it is run against the system tenant. The IDs should be retrieved programmatically instead so that it would work against the test tenant too.
In order to repro:
- remove the skip and enable CCL license:
--- a/pkg/sql/drop_function_test.go
+++ b/pkg/sql/drop_function_test.go
@@ -17,6 +17,7 @@ import (
"testing"
"github.com/cockroachdb/cockroach/pkg/base"
+ "github.com/cockroachdb/cockroach/pkg/ccl"
"github.com/cockroachdb/cockroach/pkg/sql"
"github.com/cockroachdb/cockroach/pkg/sql/catalog/descpb"
"github.com/cockroachdb/cockroach/pkg/sql/catalog/descs"
@@ -33,11 +34,10 @@ import (
func TestDropFunction(t *testing.T) {
defer leaktest.AfterTest(t)()
defer log.Scope(t).Close(t)
+ defer ccl.TestingEnableEnterprise()()
ctx := context.Background()
- s, sqlDB, _ := serverutils.StartServer(t, base.TestServerArgs{
- DefaultTestTenant: base.TestDoesNotWorkWithSecondaryTenantsButWeDontKnowWhyYet(107322),
- })
+ s, sqlDB, _ := serverutils.StartServer(t, base.TestServerArgs{})
defer s.Stopper().Stop(ctx)
tDB := sqlutils.MakeSQLRunner(sqlDB)
- run with something like
./dev test pkg/sql -f=TestDropFunction -v --stream-output -- --test_env=COCKROACH_TEST_TENANT=true
Error: Received unexpected error:
function 109 does not exist: function undefined
Jira issue: CRDB-29987
Epic CRDB-48944
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-multitenancyRelated to multi-tenancyRelated to multi-tenancyC-cleanupTech debt, refactors, loose ends, etc. Solution not expected to significantly change behavior.Tech debt, refactors, loose ends, etc. Solution not expected to significantly change behavior.T-sql-foundationsSQL Foundations Team (formerly SQL Schema + SQL Sessions)SQL Foundations Team (formerly SQL Schema + SQL Sessions)db-cy-23target-release-26.2.0v26.2.0-prerelease