Skip to content

test(disks): extract DataExport to util.go and add phase watcher#2311

Draft
hardcoretime wants to merge 1 commit intomainfrom
test/phase-transitions
Draft

test(disks): extract DataExport to util.go and add phase watcher#2311
hardcoretime wants to merge 1 commit intomainfrom
test/phase-transitions

Conversation

@hardcoretime
Copy link
Copy Markdown
Contributor

@hardcoretime hardcoretime commented May 4, 2026

Description

Adds EventPhaseWatcher utility for tracking phase transitions in e2e tests and refactors DataExport functionality.

Changes:

  • test/e2e/internal/util/event_watcher.go: Implements EventPhaseWatcher that uses Kubernetes Watch API to track phase changes in real-time instead of polling. Includes helper methods like HasSequence, ContainsPhase, and VerifyPhaseTransitions for verifying phase transitions.

  • test/e2e/blockdevice/util.go: Extracts common export utilities (DataExport, IsNFS, needPublishOption) from data_exports.go for reuse.

  • test/e2e/blockdevice/vd_phase_transitions.go: Adds VirtualDiskPhaseTransitions test that verifies the expected phase sequence (Ready → Exporting → Ready) during VirtualDisk export using the new EventPhaseWatcher.

  • test/e2e/blockdevice/data_exports.go: Removes duplicate export functions, now uses DataExport from util.go.

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

The main goal is to track resource phases during various operations (export, upload, resize, etc.) to detect problems in phase transitions.

EventPhaseWatcher provides a more reliable mechanism by using Kubernetes Watch API to observe phase changes in real-time. This allows tests to verify that resources go through the expected phase sequence and fail early if incorrect phases are observed (e.g., PVCLost, Failed, etc.).

What is the expected result?

Phase sequence verification (Ready → Exporting → Ready) is performed automatically.

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 EventPhaseWatcher for tracking phase transitions in e2e tests."
impact_level: low

@hardcoretime hardcoretime added this to the v1.9.0 milestone May 4, 2026
@hardcoretime hardcoretime force-pushed the test/phase-transitions branch from 89f840a to a62125c Compare May 6, 2026 14:20
- Add EventPhaseWatcher for tracking resource phase transitions
- Add VerifyPhaseTransitions helper for phase sequence verification
- Extract DataExport, IsNFS, needPublishOption to util.go
- Add VirtualDiskPhaseTransitions test for export flow

Signed-off-by: Roman Sysoev <roman.sysoev@flant.com>
@hardcoretime hardcoretime force-pushed the test/phase-transitions branch from a62125c to 79c5b2f Compare May 6, 2026 14:40
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.

1 participant