Skip to content

e2e test misses explicit checks on VRG state transition to Secondary during cleanup after failover operation before marking the test as passed #2694

Description

@am-agrawa

When e2e failover cmd was used to failover cephfs appset workload, the cmd output shows passed as seen below:

./run.sh -test.run TestDR/appset-deploy-cephfs/Failover
2026-08-06T15:34:34.864+0530	INFO	Using config file "config.yaml"
2026-08-06T15:34:34.865+0530	INFO	Using log file "ramen-e2e.log"
2026-08-06T15:34:34.871+0530	INFO	Using "hub" cluster name: "hub"
2026-08-06T15:34:34.928+0530	INFO	Detected "c1" managed cluster name: "dr1"
2026-08-06T15:34:34.984+0530	INFO	Detected "c2" managed cluster name: "dr2"
2026-08-06T15:34:34.985+0530	INFO	Using DeployTimeout: 5m0s
2026-08-06T15:34:34.985+0530	INFO	Using UneployTimeout: 5m0s
2026-08-06T15:34:34.985+0530	INFO	Using EnableTimeout: 5m0s
2026-08-06T15:34:34.985+0530	INFO	Using DisableTimeout: 10m0s
2026-08-06T15:34:34.985+0530	INFO	Using FailoverTimeout: 15m0s
2026-08-06T15:34:34.985+0530	INFO	Using RelocateTimeout: 15m0s
2026-08-06T15:34:34.985+0530	INFO	Using RetryInterval: 5s
=== RUN   TestDR
=== PAUSE TestDR
=== CONT  TestDR
2026-08-06T15:34:35.002+0530	INFO	Detected kubernetes distribution: "k8s"
2026-08-06T15:34:35.002+0530	INFO	Using namespaces: {RamenHubNamespace:ramen-system RamenDRClusterNamespace:ramen-system RamenOpsNamespace:ramen-ops ArgocdNamespace:argocd}
2026-08-06T15:34:35.050+0530	INFO	Validated clusters ["dr1", "dr2"] in DRPolicy "dr-policy-1m"
2026-08-06T15:34:35.060+0530	INFO	Validated clusters ["dr1", "dr2"] in ClusterSet "default"
2026-08-06T15:34:35.090+0530	INFO	Created channel "test-gitops/https-github-com-ramendr-ocm-ramen-samples-git" in cluster "hub"
=== RUN   TestDR/appset-deploy-cephfs
=== PAUSE TestDR/appset-deploy-cephfs
=== CONT  TestDR/appset-deploy-cephfs
=== RUN   TestDR/appset-deploy-cephfs/Failover
2026-08-06T15:34:35.171+0530	INFO	appset-deploy-cephfs	Failing over workload from cluster "dr2" to cluster "dr1"
2026-08-06T15:37:51.065+0530	INFO	appset-deploy-cephfs	Workload failed over
2026-08-06T15:37:51.081+0530	INFO	Deleted channel "test-gitops/https-github-com-ramendr-ocm-ramen-samples-git" in cluster "hub"
--- PASS: TestDR (6.19s)
    --- PASS: TestDR/appset-deploy-cephfs (195.97s)
        --- PASS: TestDR/appset-deploy-cephfs/Failover (195.97s)

But when checked locally, workload was still running on older primary (dr2) and VRG CURRENTSTATE was Unknown.
We should ensure that VRG has successfully transitioned to secondary and matches the desired state.

oc get deploy,pods,pvc,vr,vrg,vgr -n test-appset-deploy-cephfs --context dr2
NAME                      READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/busybox   1/1     1            1           11m

NAME                                          READY   STATUS    RESTARTS   AGE
pod/busybox-54d5b75d6c-tf4mt                  1/1     Running   0          11m
pod/volsync-rsync-tls-src-busybox-pvc-dt5hd   0/1     Error     0          72s
pod/volsync-rsync-tls-src-busybox-pvc-pml8t   0/1     Error     0          2m30s

NAME                                            STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS      VOLUMEATTRIBUTESCLASS   AGE
persistentvolumeclaim/busybox-pvc               Bound    pvc-1722fd50-d95a-461d-b978-656cf961583b   1Gi        RWX            rook-cephfs-fs1   <unset>                 17m
persistentvolumeclaim/volsync-busybox-pvc-src   Bound    pvc-8a5be97e-705a-4f22-8f9c-a763ed5d0620   1Gi        RWX            rook-cephfs-fs1   <unset>                 5m23s

NAME                                                               DESIREDSTATE   CURRENTSTATE
volumereplicationgroup.ramendr.openshift.io/appset-deploy-cephfs   secondary      Unknown
                                                                                                                                                                                                                 

This is not a timing issue as the cleanup took further 3-5mins to complete after the test was marked as passed.

May be (not sure) this happens for relocate as well, but this issue was found during failover operation, where the same workload was failedover multiple times.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtestTesting related issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions