Skip to content

Commit

Permalink
Add flake attempts to the flaky tests
Browse files Browse the repository at this point in the history
This adds attempts to the flaky tests, which are caused by two known
issues. First one isn't yet available in the CI cluster, second
is known and needs to be fixed in the Velero code:

 - kubernetes-csi/external-snapshotter#876
 - vmware-tanzu/velero#5856

Signed-off-by: Michal Pryc <mpryc@redhat.com>
  • Loading branch information
mpryc committed Jan 23, 2024
1 parent 7ce66f1 commit 62dd791
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
23 changes: 13 additions & 10 deletions tests/e2e/backup_restore_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"
)

// Define a variable for flake attempts
var flakeAttempts int = 3

type VerificationFunction func(client.Client, string) error

type appVerificationFunction func(bool, bool, BackupRestoreType) VerificationFunction
Expand Down Expand Up @@ -264,79 +267,79 @@ var _ = Describe("Backup and restore tests", func() {
func(brCase BackupRestoreCase, expectedErr error) {
runBackupAndRestore(brCase, expectedErr, updateLastBRcase, updateLastInstallTime)
},
Entry("MySQL application CSI", BackupRestoreCase{
Entry("MySQL application CSI", FlakeAttempts(flakeAttempts), BackupRestoreCase{
ApplicationTemplate: "./sample-applications/mysql-persistent/mysql-persistent-csi.yaml",
ApplicationNamespace: "mysql-persistent",
Name: "mysql-csi-e2e",
BackupRestoreType: CSI,
PreBackupVerify: mysqlReady(true, false, CSI),
PostRestoreVerify: mysqlReady(false, false, CSI),
}, nil),
Entry("Mongo application CSI", BackupRestoreCase{
Entry("Mongo application CSI", FlakeAttempts(flakeAttempts), BackupRestoreCase{
ApplicationTemplate: "./sample-applications/mongo-persistent/mongo-persistent-csi.yaml",
ApplicationNamespace: "mongo-persistent",
Name: "mongo-csi-e2e",
BackupRestoreType: CSI,
PreBackupVerify: mongoready(true, false, CSI),
PostRestoreVerify: mongoready(false, false, CSI),
}, nil),
Entry("MySQL application two Vol CSI", BackupRestoreCase{
Entry("MySQL application two Vol CSI", FlakeAttempts(flakeAttempts), BackupRestoreCase{
ApplicationTemplate: fmt.Sprintf("./sample-applications/mysql-persistent/mysql-persistent-twovol-csi.yaml"),
ApplicationNamespace: "mysql-persistent",
Name: "mysql-twovol-csi-e2e",
BackupRestoreType: CSI,
PreBackupVerify: mysqlReady(true, true, CSI),
PostRestoreVerify: mysqlReady(false, true, CSI),
}, nil),
Entry("Mongo application RESTIC", BackupRestoreCase{
Entry("Mongo application RESTIC", FlakeAttempts(flakeAttempts), BackupRestoreCase{
ApplicationTemplate: "./sample-applications/mongo-persistent/mongo-persistent.yaml",
ApplicationNamespace: "mongo-persistent",
Name: "mongo-restic-e2e",
BackupRestoreType: RESTIC,
PreBackupVerify: mongoready(true, false, RESTIC),
PostRestoreVerify: mongoready(false, false, RESTIC),
}, nil),
Entry("MySQL application RESTIC", BackupRestoreCase{
Entry("MySQL application RESTIC", FlakeAttempts(flakeAttempts), BackupRestoreCase{
ApplicationTemplate: "./sample-applications/mysql-persistent/mysql-persistent.yaml",
ApplicationNamespace: "mysql-persistent",
Name: "mysql-restic-e2e",
BackupRestoreType: RESTIC,
PreBackupVerify: mysqlReady(true, false, RESTIC),
PostRestoreVerify: mysqlReady(false, false, RESTIC),
}, nil),
Entry("Mongo application KOPIA", BackupRestoreCase{
Entry("Mongo application KOPIA", FlakeAttempts(flakeAttempts), BackupRestoreCase{
ApplicationTemplate: "./sample-applications/mongo-persistent/mongo-persistent.yaml",
ApplicationNamespace: "mongo-persistent",
Name: "mongo-kopia-e2e",
BackupRestoreType: KOPIA,
PreBackupVerify: mongoready(true, false, KOPIA),
PostRestoreVerify: mongoready(false, false, KOPIA),
}, nil),
Entry("MySQL application KOPIA", BackupRestoreCase{
Entry("MySQL application KOPIA", FlakeAttempts(flakeAttempts), BackupRestoreCase{
ApplicationTemplate: "./sample-applications/mysql-persistent/mysql-persistent.yaml",
ApplicationNamespace: "mysql-persistent",
Name: "mysql-kopia-e2e",
BackupRestoreType: KOPIA,
PreBackupVerify: mysqlReady(true, false, KOPIA),
PostRestoreVerify: mysqlReady(false, false, KOPIA),
}, nil),
Entry("Mongo application DATAMOVER", BackupRestoreCase{
Entry("Mongo application DATAMOVER", FlakeAttempts(flakeAttempts), BackupRestoreCase{
ApplicationTemplate: "./sample-applications/mongo-persistent/mongo-persistent-csi.yaml",
ApplicationNamespace: "mongo-persistent",
Name: "mongo-datamover-e2e",
BackupRestoreType: CSIDataMover,
PreBackupVerify: mongoready(true, false, CSIDataMover),
PostRestoreVerify: mongoready(false, false, CSIDataMover),
}, nil),
Entry("MySQL application DATAMOVER", BackupRestoreCase{
Entry("MySQL application DATAMOVER", FlakeAttempts(flakeAttempts), BackupRestoreCase{
ApplicationTemplate: "./sample-applications/mysql-persistent/mysql-persistent-csi.yaml",
ApplicationNamespace: "mysql-persistent",
Name: "mysql-datamover-e2e",
BackupRestoreType: CSIDataMover,
PreBackupVerify: mysqlReady(true, false, CSIDataMover),
PostRestoreVerify: mysqlReady(false, false, CSIDataMover),
}, nil),
Entry("Mongo application BlockDevice DATAMOVER", BackupRestoreCase{
Entry("Mongo application BlockDevice DATAMOVER", FlakeAttempts(flakeAttempts), BackupRestoreCase{
ApplicationTemplate: "./sample-applications/mongo-persistent/mongo-persistent-block.yaml",
PvcSuffixName: "-block-mode",
ApplicationNamespace: "mongo-persistent",
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/must-gather_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ var _ = Describe("Backup and restore tests with must-gather", func() {
Expect(err).ToNot(HaveOccurred())
}
},
Entry("Mongo application DATAMOVER", BackupRestoreCase{
Entry("Mongo application DATAMOVER", FlakeAttempts(flakeAttempts), BackupRestoreCase{
ApplicationTemplate: "./sample-applications/mongo-persistent/mongo-persistent-csi.yaml",
ApplicationNamespace: "mongo-persistent",
Name: "mongo-datamover-e2e",
Expand Down

0 comments on commit 62dd791

Please sign in to comment.