Skip to content
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

backupccl: allow backupRestoreTestSetup[Empty]WithParams to test within a tenant #88271

Merged
merged 1 commit into from
Oct 19, 2022

Conversation

msbutler
Copy link
Collaborator

@msbutler msbutler commented Sep 20, 2022

Previously, all backup unit tests that called backupRestoreTestSetupWithParams
and backupRestoreTestSetupEmptyWithParams were disabled to run within tenants,
signficantly decreasing test coverage.

This patch allows tests that call these helper methods to be probabilistically
run within tenants (including most data driven tests). This patch also manually
disables some of these tests to be run within tenants. Future work should
continue to enable bulk unit tests to run within tenants by default.

Fixes #88381, #88527, #88453, #88380
Release note: None

@msbutler msbutler self-assigned this Sep 20, 2022
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@@ -7203,7 +7216,9 @@ func TestBackupExportRequestTimeout(t *testing.T) {

allowRequest := make(chan struct{})
defer close(allowRequest)
params := base.TestClusterArgs{}

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

nvm, I figured this flake out. Will amend the commit after this current CI run

pkg/ccl/backupccl/backup_test.go Show resolved Hide resolved
pkg/ccl/backupccl/backup_test.go Outdated Show resolved Hide resolved
pkg/ccl/backupccl/backup_test.go Outdated Show resolved Hide resolved
pkg/ccl/backupccl/backup_test.go Show resolved Hide resolved
pkg/ccl/backupccl/backup_test.go Show resolved Hide resolved
pkg/ccl/backupccl/testdata/backup-restore/feature-flags Outdated Show resolved Hide resolved
@@ -180,31 +180,14 @@ query-sql
WITH descs AS (
SHOW BACKUP LATEST IN 'nodelocal://0/test/'
)
SELECT database_name, parent_schema_name, object_name, object_type, is_full_cluster FROM descs
SELECT
Copy link
Contributor

Choose a reason for hiding this comment

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

why did this change?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

got rid of the tenant_settings system table. I also don't think the test needed to show all these other rows anyway.

pkg/ccl/backupccl/utils_test.go Outdated Show resolved Hide resolved
Copy link
Collaborator Author

@msbutler msbutler left a comment

Choose a reason for hiding this comment

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

RFAL!

pkg/ccl/backupccl/backup_test.go Show resolved Hide resolved
pkg/ccl/backupccl/backup_test.go Outdated Show resolved Hide resolved
pkg/ccl/backupccl/backup_test.go Show resolved Hide resolved
pkg/ccl/backupccl/backup_test.go Show resolved Hide resolved
pkg/ccl/backupccl/backup_test.go Outdated Show resolved Hide resolved
pkg/ccl/backupccl/testdata/backup-restore/feature-flags Outdated Show resolved Hide resolved
@@ -180,31 +180,14 @@ query-sql
WITH descs AS (
SHOW BACKUP LATEST IN 'nodelocal://0/test/'
)
SELECT database_name, parent_schema_name, object_name, object_type, is_full_cluster FROM descs
SELECT
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

got rid of the tenant_settings system table. I also don't think the test needed to show all these other rows anyway.

pkg/ccl/backupccl/utils_test.go Outdated Show resolved Hide resolved
@stevendanna
Copy link
Collaborator

#88557 might help for some of the tests that aren't working because of testing hooks.

@msbutler msbutler force-pushed the butler-tenant-unit-tests branch 3 times, most recently from ecaf793 to c321fef Compare September 27, 2022 20:24
@msbutler
Copy link
Collaborator Author

RFAL!

@msbutler msbutler force-pushed the butler-tenant-unit-tests branch 3 times, most recently from 3117472 to 81fc39c Compare October 14, 2022 14:56
@msbutler
Copy link
Collaborator Author

@stevendanna friendly ping on this!

Copy link
Contributor

@adityamaru adityamaru left a comment

Choose a reason for hiding this comment

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

LGTM to merge as a first step as we tackle the remaining TODOs and skips. Nice work!

pkg/ccl/backupccl/backup_test.go Outdated Show resolved Hide resolved
…in tenant

Previously, all backup unit tests that called backupRestoreTestSetupWithParams
and backupRestoreTestSetupEmptyWithParams were disabled to run within tenants,
signficantly decreasing test coverage.

This patch allows tests that call these helper methods to be probabilistically
run within tenants (including most data driven tests). This patch also manually
disables some of these tests to be run within tenants. Future work should
continue to enable bulk unit tests to run within tenants by default.

Fixes cockroachdb#88381, cockroachdb#88527, cockroachdb#88453, cockroachdb#88380
Release note: None
@msbutler msbutler force-pushed the butler-tenant-unit-tests branch from 81fc39c to fd7f48d Compare October 19, 2022 13:43
@msbutler
Copy link
Collaborator Author

TFTRs!!!

bors r=adityamaru

@craig
Copy link
Contributor

craig bot commented Oct 19, 2022

Build succeeded:

@craig craig bot merged commit e711c31 into cockroachdb:master Oct 19, 2022
@msbutler msbutler deleted the butler-tenant-unit-tests branch October 19, 2022 17:08
@adityamaru
Copy link
Contributor

@adityamaru
Copy link
Contributor

Flaky behaviour started around 1300 today https://teamcity.cockroachdb.com/project.html?projectId=Cockroach_Ci_TestsAwsLinuxArm64BigVm&testNameId=-4898685845226892981&tab=testDetails&branch_Cockroach_Ci_TestsAwsLinuxArm64BigVm=%3Cdefault%3E which roughly lines up with when this was merged. Looks like when run as a tenant the DD test is timing out the package.

adityamaru added a commit to adityamaru/cockroach that referenced this pull request Oct 20, 2022
In cockroachdb#88271 we enabled most DD tests to run as tenants
but we saw an uptick in timeouts on CI. This change disables
these tests from being run as tenants while we dig into the
timeouts.

Release note: None
craig bot pushed a commit that referenced this pull request Oct 20, 2022
90302: backupccl: disable tenants in datadriven test r=stevendanna a=adityamaru

In #88271 we enabled most DD tests to run as tenants but we saw an uptick in timeouts on CI. This change disables these tests from being run as tenants while we dig into the timeouts.

Release note: None

Epic: none

Co-authored-by: adityamaru <[email protected]>
@msbutler
Copy link
Collaborator Author

hmmm, i'll try stressing the DD test with MT on my gce worker to see if anything shakes out.

msbutler added a commit to msbutler/cockroach that referenced this pull request Oct 21, 2022
TestDataDriven unit tests were recently enabled to run within tenants(cockroachdb#88271).
This was quickly disabled as it caused TestDataDriven/restore-grants to flake
(tracked in cockroachdb#90444). This patch re-enables TestDataDriven unit tests to run
within a tenant, except for TestDataDriven/restore-grants. Further
investigation is needed to understand why restore-grants hangs when run within
a tenant.

Informs cockroachdb#90444

Release note: None
msbutler added a commit to msbutler/cockroach that referenced this pull request Oct 24, 2022
TestDataDriven unit tests were recently enabled to run within tenants(cockroachdb#88271).
This was quickly disabled as it caused TestDataDriven/restore-grants to flake
(tracked in cockroachdb#90444). This patch re-enables TestDataDriven unit tests to run
within a tenant, except for TestDataDriven/restore-grants. Further
investigation is needed to understand why restore-grants hangs when run within
a tenant.

Informs cockroachdb#90444

Release note: None
craig bot pushed a commit that referenced this pull request Oct 24, 2022
90446: backupccl: re-enable data driven tests to run within a tenant r=adityamaru,stevendanna a=msbutler

TestDataDriven unit tests were recently enabled to run within tenants(#88271). This was quickly disabled as it caused TestDataDriven/restore-grants to flake (tracked in #90444). This patch re-enables TestDataDriven unit tests to run within a tenant, except for TestDataDriven/restore-grants. Further investigation is needed to understand why restore-grants hangs when run within a tenant.

Informs #90444

Release note: None

Co-authored-by: Michael Butler <[email protected]>
THardy98 pushed a commit to THardy98/cockroach that referenced this pull request Nov 2, 2022
In cockroachdb#88271 we enabled most DD tests to run as tenants
but we saw an uptick in timeouts on CI. This change disables
these tests from being run as tenants while we dig into the
timeouts.

Release note: None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

backupccl: TestBackupRestoreDuringUserDefinedTypeChange panics within tenant
4 participants