Skip to content

test(vmop): add e2e tests for VMOP superseding#2559

Merged
danilrwx merged 2 commits into
mainfrom
test/vmop/supersede-e2e
Jun 30, 2026
Merged

test(vmop): add e2e tests for VMOP superseding#2559
danilrwx merged 2 commits into
mainfrom
test/vmop/supersede-e2e

Conversation

@danilrwx

@danilrwx danilrwx commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Description

Adds e2e coverage for the Superseded VMOP phase introduced in #2492.

Two deterministic scenarios verify that a non-terminal VMOP transitions to the
Superseded phase (with condition Completed, reason Superseded) when a newer
conflicting VMOP arrives for the same VM:

  • Start superseded by Stop — the VM is pinned to a non-existent node, so its
    launcher pod stays Unschedulable and the Start VMOP never leaves InProgress.
  • Migrate superseded by Stop — the migration target is pinned to a non-existent
    node, so the target pod stays Unschedulable and the Migrate VMOP stays in
    Scheduling/InProgress.

Both tests run under Label(precheck.NoPrecheck).

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

The Superseded phase (#2492) shipped without e2e coverage. The hard part of
testing superseding is timing: the operation being superseded must still be
non-terminal when the superseding VMOP arrives. A fast workload (e.g. an Alpine
VM that migrates in seconds) makes such a test inherently racy.

Pinning the workload to a non-existent node removes the race entirely: the
launcher / migration target pod is permanently Unschedulable, so the
superseded operation stays in a non-terminal phase for as long as needed,
without sleeps or stress generators.

What is the expected result?

cd test/e2e && FOCUS=VirtualMachineSupersede task run

Both specs pass:

Ran 2 of 105 Specs
SUCCESS! -- 2 Passed | 0 Failed

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

section: test
type: chore
summary: Add e2e tests for VMOP superseding.
impact_level: low

@danilrwx danilrwx force-pushed the test/vmop/supersede-e2e branch from 1aec9bf to 14666b4 Compare June 30, 2026 12:06
@danilrwx danilrwx added this to the v1.10.0 milestone Jun 30, 2026
@danilrwx danilrwx marked this pull request as ready for review June 30, 2026 12:08
@danilrwx danilrwx requested a review from Isteb4k as a code owner June 30, 2026 12:08
danilrwx added 2 commits June 30, 2026 15:40
Add two deterministic e2e scenarios that verify a non-terminal VMOP
transitions to the Superseded phase when a newer conflicting VMOP arrives
for the same VM:

- Start superseded by Stop: the VM is pinned to a non-existent node, so its
  launcher pod stays Unschedulable and the Start VMOP never leaves InProgress.
- Migrate superseded by Stop: the migration target is pinned to a non-existent
  node, so the target pod stays Unschedulable and the Migrate VMOP stays in
  Scheduling/InProgress.

Pinning the workload to a non-existent node keeps the superseded operation in
a non-terminal phase without any timing race.

Signed-off-by: Daniil Antoshin <daniil.antoshin@flant.com>
Extend the VMOP superseding e2e suite beyond Start->Stop:

- Migrate superseded by Stop or Restart: parametrized over the superseding
  operation; the migration target is pinned to a non-existent node so the
  Migrate VMOP stays InProgress.
- Restart superseded by a forced Stop or Restart: the VM CPU cores are bumped
  beyond cluster capacity, which is a restart-required change (socket topology
  changes) rather than a hotplug migration, so the restarted launcher pod stays
  Unschedulable and the Restart VMOP stays InProgress.

All scenarios keep the superseded operation in a non-terminal phase without a
timing race and assert it reaches the Superseded phase.

Signed-off-by: Daniil Antoshin <daniil.antoshin@flant.com>
@danilrwx danilrwx force-pushed the test/vmop/supersede-e2e branch from b35fa13 to 0001f11 Compare June 30, 2026 13:41
@danilrwx danilrwx merged commit 98b1f02 into main Jun 30, 2026
30 of 32 checks passed
@danilrwx danilrwx deleted the test/vmop/supersede-e2e branch June 30, 2026 14:17
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.

2 participants