Change:
return nil }, }, <ins> { name: "scheduled pod uses read-write-once-pod pvc", init: func(cs kubernetes.Interface, ns string) error { _, err := createNode(cs, st.MakeNode().Name("node").Obj()) if err != nil { return fmt.Errorf("cannot create node: %v", err) } storage := v1.ResourceRequirements{Requests: v1.ResourceList{v1.ResourceStorage: resource.MustParse("1Mi")}} volType := v1.HostPathDirectoryOrCreate pv, err := testutils.CreatePV(cs, st.MakePersistentVolume(). Name("pv-with-read-write-once-pod"). AccessModes([]v1.PersistentVolumeAccessMode{v1.ReadWriteOncePod}). Capacity(storage.Requests). HostPathVolumeSource(&v1.HostPathVolumeSource{Path: "/mnt", Type: &volType}). Obj()) if err != nil { return fmt.Errorf("cannot create pv: %v", err) } pvc, err := testutils.CreatePVC(cs, st.MakePersistentVolumeClaim(). Name("pvc-with-read-write-once-pod"). Namespace(ns). // Annotation and volume name required for PVC to be considered bound. Annotation(volume.AnnBindCompleted, "true"). VolumeName(pv.Name). AccessModes([]v1.PersistentVolumeAccessMode{v1.ReadWriteOncePod}). Resources(storage). Obj()) if err != nil { return fmt.Errorf("cannot create pvc: %v", err) } pod := initPausePod(&testutils.PausePodConfig{ Name:      "pod-to-be-deleted", Namespace: ns, Volumes: []v1.Volume{{ Name: "volume", VolumeSource: v1.VolumeSource{ PersistentVolumeClaim: &v1.PersistentVolumeClaimVolumeSource{ ClaimName: pvc.Name, }, }, }}, }) if _, err := createPausePod(cs, pod); err != nil { return fmt.Errorf("cannot create pod: %v", err) } return nil }, pod: &testutils.PausePodConfig{ Name: "pod-to-take-over-pvc", Volumes: []v1.Volume{{ Name: "volume", VolumeSource: v1.VolumeSource{ PersistentVolumeClaim: &v1.PersistentVolumeClaimVolumeSource{ ClaimName: "pvc-with-read-write-once-pod", }, }, }}, }, update: func(cs kubernetes.Interface, ns string) error { return deletePod(cs, "pod-to-be-deleted", ns) }, enableReadWriteOncePod: true, }, </ins> } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { <ins> defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.ReadWriteOncePod, tt.enableReadWriteOncePod)() </ins> testCtx := initTest(t, "scheduler-informer") defer testutils.CleanupTest(t, testCtx)

Discussion:
We need an integration test for the scheduler enforcement of the alpha feature. This is required for beta graduation; we need to collect signal on the current behavior before we can proceed. See this comment for context:
/sig storage /sig scheduler
This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the label and provide further guidance. The label can be by org members by writing in a comment. <detailsInstructions for interacting with me using PR comments are available . If you have questions or suggestions related to my behavior, please file an issue against the repository. </details
The label(s) cannot be applied, because the repository doesn't have them. <detailsIn response to : /sig storage /sig scheduler Instructions for interacting with me using PR comments are available . If you have questions or suggestions related to my behavior, please file an issue against the repository. </details
/sig scheduling