Skip to content

Commit

Permalink
fix(backup_test): remove partial upload check from TestBackupResumeIn…
Browse files Browse the repository at this point in the history
…tegration

This check isn't implemented correctly, as starting from 27b1d23,
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.
  • Loading branch information
Michal-Leszczynski committed Oct 8, 2024
1 parent af67b88 commit 63f1787
Showing 1 changed file with 0 additions and 41 deletions.
41 changes: 0 additions & 41 deletions pkg/service/backup/service_backup_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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")
}
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 63f1787

Please sign in to comment.