Use offset in ExpectMigrationSuccess
@@ -17,15 +17,19 @@ import (
)
func ExpectMigrationSuccess(virtClient kubecli.KubevirtClient, migration *v1.VirtualMachineInstanceMigration, timeout int) string {
+ return expectMigrationSuccessWithOffset(2, virtClient, migration, timeout)
+}
+
+func expectMigrationSuccessWithOffset(offset int, virtClient kubecli.KubevirtClient, migration *v1.VirtualMachineInstanceMigration, timeout int) string {
By("Waiting until the Migration Completes")
uid := ""
- Eventually(func() error {
+ EventuallyWithOffset(offset, func() error {
migration, err := virtClient.VirtualMachineInstanceMigration(migration.Namespace).Get(migration.Name, &metav1.GetOptions{})
if err != nil {
return err
}
- Expect(migration.Status.Phase).ToNot(Equal(v1.MigrationFailed), "migration should not fail")
+ ExpectWithOffset(offset+1, migration.Status.Phase).ToNot(Equal(v1.MigrationFailed), "migration should not fail")
uid = string(migration.UID)
if migration.Status.Phase == v1.MigrationSucceeded {
