Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
100536: kvtenantccl: unskip TestTenantUpgradeInterlock (and move it to its own package) r=arulajmani a=knz

Fixes cockroachdb#99593

It does takes an enormous amount of time to run successfully, more than the previous timeout allowed:

```
--- PASS: TestTenantUpgradeInterlock (316.36s)
    --- PASS: TestTenantUpgradeInterlock/lagging_binary_version (120.85s)
        --- PASS: TestTenantUpgradeInterlock/lagging_binary_version/pause_after_first_check_for_instances (9.02s)
        --- PASS: TestTenantUpgradeInterlock/lagging_binary_version/pause_after_fence_RPC (10.11s)
        --- PASS: TestTenantUpgradeInterlock/lagging_binary_version/pause_after_fence_write_to_settings_table (20.27s)
        --- PASS: TestTenantUpgradeInterlock/lagging_binary_version/pause_after_second_check_of_instances (20.20s)
        --- PASS: TestTenantUpgradeInterlock/lagging_binary_version/pause_after_migration (20.45s)
        --- PASS: TestTenantUpgradeInterlock/lagging_binary_version/pause_after_version_bump_RPC (20.28s)
        --- PASS: TestTenantUpgradeInterlock/lagging_binary_version/pause_after_write_to_settings_table (20.51s)
    --- PASS: TestTenantUpgradeInterlock/current_binary_version (195.51s)
        --- PASS: TestTenantUpgradeInterlock/current_binary_version/pause_after_first_check_for_instances (20.00s)
        --- PASS: TestTenantUpgradeInterlock/current_binary_version/pause_after_fence_RPC (30.23s)
        --- PASS: TestTenantUpgradeInterlock/current_binary_version/pause_after_fence_write_to_settings_table (29.02s)
        --- PASS: TestTenantUpgradeInterlock/current_binary_version/pause_after_second_check_of_instances (29.14s)
        --- PASS: TestTenantUpgradeInterlock/current_binary_version/pause_after_migration (29.00s)
        --- PASS: TestTenantUpgradeInterlock/current_binary_version/pause_after_version_bump_RPC (29.03s)
        --- PASS: TestTenantUpgradeInterlock/current_binary_version/pause_after_write_to_settings_table (29.08s)
PASS
INFO: Elapsed time: 318.059s, Critical Path: 317.36s
INFO: 2 processes: 1 internal, 1 processwrapper-sandbox.
//pkg/ccl/kvccl/kvtenantccl:kvtenantccl_test                             PASSED in 317.2s
```

(and this is on a faster machine than in CI)

Release note: None

Co-authored-by: Raphael 'kena' Poss <[email protected]>
  • Loading branch information
craig[bot] and knz committed Apr 4, 2023
2 parents 07c7d4b + 5182478 commit 772b8cc
Show file tree
Hide file tree
Showing 8 changed files with 582 additions and 378 deletions.
6 changes: 6 additions & 0 deletions pkg/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ ALL_TESTS = [
"//pkg/ccl/jobsccl/jobsprotectedtsccl:jobsprotectedtsccl_test",
"//pkg/ccl/jwtauthccl:jwtauthccl_test",
"//pkg/ccl/kvccl/kvfollowerreadsccl:kvfollowerreadsccl_test",
"//pkg/ccl/kvccl/kvtenantccl/upgradeccl:upgradeccl_test",
"//pkg/ccl/kvccl/kvtenantccl/upgradeinterlockccl:upgradeinterlockccl_test",
"//pkg/ccl/kvccl/kvtenantccl:kvtenantccl_test",
"//pkg/ccl/logictestccl/tests/3node-tenant-multiregion:3node-tenant-multiregion_test",
"//pkg/ccl/logictestccl/tests/3node-tenant:3node-tenant_test",
Expand Down Expand Up @@ -775,6 +777,8 @@ GO_TARGETS = [
"//pkg/ccl/jwtauthccl:jwtauthccl_test",
"//pkg/ccl/kvccl/kvfollowerreadsccl:kvfollowerreadsccl",
"//pkg/ccl/kvccl/kvfollowerreadsccl:kvfollowerreadsccl_test",
"//pkg/ccl/kvccl/kvtenantccl/upgradeccl:upgradeccl_test",
"//pkg/ccl/kvccl/kvtenantccl/upgradeinterlockccl:upgradeinterlockccl_test",
"//pkg/ccl/kvccl/kvtenantccl:kvtenantccl",
"//pkg/ccl/kvccl/kvtenantccl:kvtenantccl_test",
"//pkg/ccl/kvccl:kvccl",
Expand Down Expand Up @@ -2417,6 +2421,8 @@ GET_X_DATA_TARGETS = [
"//pkg/ccl/kvccl:get_x_data",
"//pkg/ccl/kvccl/kvfollowerreadsccl:get_x_data",
"//pkg/ccl/kvccl/kvtenantccl:get_x_data",
"//pkg/ccl/kvccl/kvtenantccl/upgradeccl:get_x_data",
"//pkg/ccl/kvccl/kvtenantccl/upgradeinterlockccl:get_x_data",
"//pkg/ccl/logictestccl:get_x_data",
"//pkg/ccl/logictestccl/tests/3node-tenant:get_x_data",
"//pkg/ccl/logictestccl/tests/3node-tenant-multiregion:get_x_data",
Expand Down
14 changes: 0 additions & 14 deletions pkg/ccl/kvccl/kvtenantccl/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ go_test(
"tenant_range_lookup_test.go",
"tenant_scan_range_descriptors_test.go",
"tenant_trace_test.go",
"tenant_upgrade_test.go",
],
args = ["-test.timeout=895s"],
embed = [":kvtenantccl"],
Expand All @@ -63,10 +62,8 @@ go_test(
deps = [
"//pkg/base",
"//pkg/ccl",
"//pkg/clusterversion",
"//pkg/config",
"//pkg/gossip",
"//pkg/jobs",
"//pkg/keys",
"//pkg/kv/kvclient/kvcoord",
"//pkg/kv/kvclient/kvtenant",
Expand All @@ -80,24 +77,13 @@ go_test(
"//pkg/security",
"//pkg/security/securityassets",
"//pkg/security/securitytest",
"//pkg/security/username",
"//pkg/server",
"//pkg/settings",
"//pkg/settings/cluster",
"//pkg/spanconfig",
"//pkg/sql",
"//pkg/sql/catalog/lease",
"//pkg/sql/sessiondatapb",
"//pkg/sql/sqlinstance/instancestorage",
"//pkg/sql/sqlliveness/slinstance",
"//pkg/sql/stats",
"//pkg/testutils",
"//pkg/testutils/serverutils",
"//pkg/testutils/skip",
"//pkg/testutils/sqlutils",
"//pkg/testutils/testcluster",
"//pkg/upgrade",
"//pkg/upgrade/upgradebase",
"//pkg/util",
"//pkg/util/grpcutil",
"//pkg/util/hlc",
Expand Down
40 changes: 40 additions & 0 deletions pkg/ccl/kvccl/kvtenantccl/upgradeccl/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
load("//build/bazelutil/unused_checker:unused.bzl", "get_x_data")
load("@io_bazel_rules_go//go:def.bzl", "go_test")

go_test(
name = "upgradeccl_test",
srcs = [
"main_test.go",
"tenant_upgrade_test.go",
],
args = ["-test.timeout=295s"],
tags = ["ccl_test"],
deps = [
"//pkg/base",
"//pkg/ccl",
"//pkg/clusterversion",
"//pkg/jobs",
"//pkg/roachpb",
"//pkg/security/securityassets",
"//pkg/security/securitytest",
"//pkg/security/username",
"//pkg/server",
"//pkg/settings/cluster",
"//pkg/spanconfig",
"//pkg/sql/sqlinstance/instancestorage",
"//pkg/sql/sqlliveness/slinstance",
"//pkg/testutils/serverutils",
"//pkg/testutils/skip",
"//pkg/testutils/sqlutils",
"//pkg/testutils/testcluster",
"//pkg/upgrade",
"//pkg/upgrade/upgradebase",
"//pkg/util/leaktest",
"//pkg/util/log",
"//pkg/util/randutil",
"//pkg/util/stop",
"@com_github_stretchr_testify//require",
],
)

get_x_data(name = "get_x_data")
33 changes: 33 additions & 0 deletions pkg/ccl/kvccl/kvtenantccl/upgradeccl/main_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// Copyright 2023 The Cockroach Authors.
//
// Licensed as a CockroachDB Enterprise file under the Cockroach Community
// License (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
//
// https://github.com/cockroachdb/cockroach/blob/master/licenses/CCL.txt

package upgradeccl_test

import (
"os"
"testing"

"github.com/cockroachdb/cockroach/pkg/ccl"
"github.com/cockroachdb/cockroach/pkg/security/securityassets"
"github.com/cockroachdb/cockroach/pkg/security/securitytest"
"github.com/cockroachdb/cockroach/pkg/server"
"github.com/cockroachdb/cockroach/pkg/testutils/serverutils"
"github.com/cockroachdb/cockroach/pkg/testutils/testcluster"
"github.com/cockroachdb/cockroach/pkg/util/randutil"
)

//go:generate ../../../util/leaktest/add-leaktest.sh *_test.go

func TestMain(m *testing.M) {
defer ccl.TestingEnableEnterprise()()
securityassets.SetLoader(securitytest.EmbeddedAssets)
randutil.SeedForTests()
serverutils.InitTestServerFactory(server.TestServerFactory)
serverutils.InitTestClusterFactory(testcluster.TestClusterFactory)
os.Exit(m.Run())
}
Loading

0 comments on commit 772b8cc

Please sign in to comment.