Skip to content

test: skip StorageClassMigration when VD Migration Controller reverts volume migration#2117

Merged
universal-itengineer merged 5 commits into
mainfrom
chore/test/skip-condition-mgration-storage
Mar 26, 2026
Merged

test: skip StorageClassMigration when VD Migration Controller reverts volume migration#2117
universal-itengineer merged 5 commits into
mainfrom
chore/test/skip-condition-mgration-storage

Conversation

@universal-itengineer
Copy link
Copy Markdown
Member

@universal-itengineer universal-itengineer commented Mar 18, 2026

Description

Skip StorageClassMigration e2e tests when VD Migration Controller reverts volume migration.

Changes:

  • New SkipIfVDMigrationReverted function in test/e2e/internal/util/vm.go: checks vd.Status.MigrationState for Result=Failed with Message="Migration reverted." and skips the test if found.
  • Added SkipIfVDMigrationReverted calls inside polling loops in:
    • UntilVMMigrationSucceeded
    • untilVirtualDisksMigrationsSucceeded
    • "two migrations in a row" test in volume_migration_storage_class_changed.go
  • Minor fix: replaced Expect(err).NotTo(HaveOccurred()) with return err inside Eventually(func() error {...}) callback to properly propagate errors instead of failing immediately.

Why do we need it, and what problem does it solve?

VD Migration Controller may revert an in-progress volume migration for various reasons (VM not running, VM not migrating, etc.). When this happens, e2e tests polling for migration success wait until timeout and then fail, even though the migration was intentionally reverted by the controller. This creates flaky test failures unrelated to actual code defects.

What is the expected result?

During polling, if any VirtualDisk in the namespace has MigrationState.Result=Failed and MigrationState.Message="Migration reverted.", the test is immediately skipped with a clear message instead of waiting for timeout and failing.

Checklist

  • The code is covered by unit tests.
  • e2e tests passed.
  • Documentation updated according to the changes.
  • Changes were tested in the Kubernetes cluster manually.

Changelog entries

@universal-itengineer universal-itengineer added this to the v1.7.0 milestone Mar 18, 2026
@universal-itengineer universal-itengineer force-pushed the chore/test/skip-condition-mgration-storage branch 2 times, most recently from 5b1cf21 to e5ef26d Compare March 24, 2026 11:09
@universal-itengineer universal-itengineer modified the milestones: v1.7.0, v1.8.0 Mar 24, 2026
Signed-off-by: Nikita Korolev <nikita.korolev@flant.com>
@universal-itengineer universal-itengineer force-pushed the chore/test/skip-condition-mgration-storage branch from e5ef26d to c9605ae Compare March 24, 2026 13:25
Signed-off-by: Nikita Korolev <nikita.korolev@flant.com>
@universal-itengineer universal-itengineer force-pushed the chore/test/skip-condition-mgration-storage branch from c9605ae to c429b25 Compare March 24, 2026 15:00
@universal-itengineer universal-itengineer marked this pull request as ready for review March 24, 2026 15:20
Signed-off-by: Nikita Korolev <nikita.korolev@flant.com>
Signed-off-by: Nikita Korolev <nikita.korolev@flant.com>
Signed-off-by: Nikita Korolev <nikita.korolev@flant.com>
@universal-itengineer universal-itengineer force-pushed the chore/test/skip-condition-mgration-storage branch from 0eceb75 to a5fed38 Compare March 26, 2026 08:01
@universal-itengineer universal-itengineer changed the title test: skip StorageClassMigration if msg 'Will be reverted' test: skip StorageClassMigration when VD Migration Controller reverts volume migration Mar 26, 2026
@universal-itengineer universal-itengineer merged commit 19a45f6 into main Mar 26, 2026
32 of 34 checks passed
@universal-itengineer universal-itengineer deleted the chore/test/skip-condition-mgration-storage branch March 26, 2026 08:32
danilrwx pushed a commit that referenced this pull request Mar 27, 2026
… volume migration (#2117)

Description
Skip StorageClassMigration e2e tests when VD Migration Controller reverts volume migration.

---------

Signed-off-by: Nikita Korolev <nikita.korolev@flant.com>
Signed-off-by: Daniil Antoshin <daniil.antoshin@flant.com>
Isteb4k pushed a commit that referenced this pull request Mar 30, 2026
… volume migration (#2117)

Description
Skip StorageClassMigration e2e tests when VD Migration Controller reverts volume migration.

---------

Signed-off-by: Nikita Korolev <nikita.korolev@flant.com>
(cherry picked from commit 19a45f6)
@Isteb4k Isteb4k modified the milestones: v1.8.0, v1.7.0 Mar 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants