From 63f1787212f56e07dc97adccd6c5d1c5916f1fac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Leszczy=C5=84ski?= <2000michal@wp.pl> Date: Tue, 8 Oct 2024 12:25:27 +0200 Subject: [PATCH] fix(backup_test): remove partial upload check from TestBackupResumeIntegration This check isn't implemented correctly, as starting from 27b1d233, file names are not stored in the SM DB. It means that 'sfs' was always empty. Nevertheless, the partial upload check could still fail when 's3f' was empty as well. This test does not implement any breakpoint to ensure that backup is paused after transferring at least a single file (it just waits for the transfers to start). That's why this check was flaky and didn't do anything meaningful, so it is removed from the test. --- .../backup/service_backup_integration_test.go | 41 ------------------- 1 file changed, 41 deletions(-) diff --git a/pkg/service/backup/service_backup_integration_test.go b/pkg/service/backup/service_backup_integration_test.go index 7edf9d732..ede22060a 100644 --- a/pkg/service/backup/service_backup_integration_test.go +++ b/pkg/service/backup/service_backup_integration_test.go @@ -26,7 +26,6 @@ import ( "github.com/scylladb/go-log" "github.com/scylladb/go-set/strset" "github.com/scylladb/gocqlx/v2" - "github.com/scylladb/gocqlx/v2/qb" "github.com/scylladb/scylla-manager/v3/pkg/service/cluster" "github.com/scylladb/scylla-manager/v3/pkg/util" "go.uber.org/atomic" @@ -187,35 +186,6 @@ func (h *backupTestHelper) listS3Files() (manifests, schemas, files []string) { return } -func (h *backupTestHelper) progressFilesSet() *strset.Set { - h.T.Helper() - - files := strset.New() - q := table.BackupRunProgress.SelectQuery(h.Session).BindMap(qb.M{ - "cluster_id": h.ClusterID, - "task_id": h.TaskID, - "run_id": h.RunID, - }) - iter := q.Iter() - defer func() { - iter.Close() - q.Release() - }() - - pr := &backup.RunProgress{} - for iter.StructScan(pr) { - fs := pr.Files() - for i := range fs { - if strings.Contains(fs[i].Name, ScyllaManifest) { - continue - } - files.Add(fs[i].Name) - } - } - - return files -} - func restartAgents(h *CommonTestHelper) { execOnAllHosts(h, "supervisorctl restart scylla-manager-agent") } @@ -1064,17 +1034,6 @@ func TestBackupResumeIntegration(t *testing.T) { Print("And: nothing is transferring") h.waitNoTransfers() - Print("And: snapshot is partially uploaded") - _, _, s3Files := h.listS3Files() - sfs := h.progressFilesSet() - s3f := strset.New() - for i := range s3Files { - s3f.Add(path.Base(s3Files[i])) - } - if s3f.IsEqual(sfs) { - h.T.Fatalf("Expected partial upload, got\n%v,\n%v", sfs, s3f) - } - Print("When: backup is resumed with new RunID") err := h.service.Backup(context.Background(), h.ClusterID, h.TaskID, uuid.NewTime(), target) if err != nil {