Change:
// Individual tests follow: // <del> // Create an nfs PV, a claim that matches the PV, a pod that contains the // claim. Verify that the PV and PVC bind correctly and that the pod can // write to the nfs volume. It("should create a PersistentVolume, Claim, and Pod that will test write access of the volume [Flaky]", func() { </del> <ins> // Create an nfs PV, then a claim that matches the PV, and a pod that // contains the claim. Verify that the PV and PVC bind correctly, and // that the pod can write to the nfs volume. It("should create a non-pre-bound PV and PVC: test write access [Flaky]", func() { </ins> <del> pv, pvc, err = createPVandPVC(c, serverIP, ns, true /*pv first*/, false) </del> <ins> pv, pvc, err = createPVPVC(c, serverIP, ns, false) </ins> if err != nil { framework.Failf("%v", err) } <del> pv, pvc, err = waitAndValidatePVandPVC(c, ns, pv, pvc) </del> <ins> // validate PV-PVC, create and verify writer pod, delete PVC // and PV pv, pvc, err = completeTest(f, c, ns, pv, pvc) </ins> if err != nil { framework.Failf("%v", err) } <ins> }) </ins> <del> By("Checking pod has write access to PersistentVolume") if err = createWaitAndDeletePod(f, c, ns, pvc.Name); err != nil { framework.Failf("%v", err) } </del> <ins> // Create a claim first, then a nfs PV that matches the claim, and a // pod that contains the claim. Verify that the PV and PVC bind // correctly, and that the pod can write to the nfs volume. It("create a PVC and non-pre-bound PV: test write access [Flaky]", func() { </ins> <del> // Delete the PVC before deleting PV, wait for PV to be Available pv, pvc, err = deletePVCandValidatePV(c, ns, pvc, pv) </del> <ins> pv, pvc, err = createPVCPV(c, serverIP, ns, false) </ins> if err != nil { framework.Failf("%v", err) } <del> // Last cleanup step is to delete the pv pv, err = deletePersistentVolume(c, pv) </del> <ins> // validate PV-PVC, create and verify writer pod, delete PVC // and PV pv, pvc, err = completeTest(f, c, ns, pv, pvc) </ins> if err != nil { framework.Failf("%v", err) } }) <del> // Create an nfs PV that is *pre-bound* to a claim. Create a pod that // contains the claim. Verify that the PV and PVC bind correctly and that // the pod can write to the nfs volume. It("should create a pre-bound PersistentVolume, Claim, and Pod that will test write access of the volume [Flaky]", func() { </del> <ins> // Create a claim first, then a pre-bound nfs PV that matches the claim, // and a pod that contains the claim. Verify that the PV and PVC bind // correctly, and that the pod can write to the nfs volume. It("create a PVC and a pre-bound PV: test write access [Flaky]", func() { </ins> <del> pv, pvc, err = createPVandPVC(c, serverIP, ns, false /*pvc first*/, true /*prebind*/) </del> <ins> pv, pvc, err = createPVCPV(c, serverIP, ns, true) </ins> if err != nil { framework.Failf("%v", err) } <del> pv, pvc, err = waitAndValidatePVandPVC(c, ns, pv, pvc) </del> <ins> // validate PV-PVC, create and verify writer pod, delete PVC // and PV pv, pvc, err = completeTest(f, c, ns, pv, pvc) </ins> if err != nil { framework.Failf("%v", err) } <ins> }) </ins> <del> // checkPod writes to the nfs volume By("Checking pod has write access to pre-bound PersistentVolume") // Instantiate pod, wait for it to exit, then delete it if err = createWaitAndDeletePod(f, c, ns, pvc.Name); err != nil { framework.Failf("%v", err) } </del> <ins> // Create a nfs PV first, then a pre-bound PVC that matches the PV, // and a pod that contains the claim. Verify that the PV and PVC bind // correctly, and that the pod can write to the nfs volume. It("create a PV and a pre-bound PVC: test write access [Flaky]", func() { </ins> <del> // Delete the PVC before deleting PV, wait for PV to be Available pv, pvc, err = deletePVCandValidatePV(c, ns, pvc, pv) </del> <ins> pv, pvc, err = createPVPVC(c, serverIP, ns, true) </ins> if err != nil { framework.Failf("%v", err) } <del> // Last cleanup step is to delete the pv pv, err = deletePersistentVolume(c, pv) </del> <ins> // validate PV-PVC, create and verify writer pod, delete PVC // and PV pv, pvc, err = completeTest(f, c, ns, pv, pvc) </ins> if err != nil { framework.Failf("%v", err) } }) }) <del> // Returns a PV definition based on the nfs server IP. If the PVC is not nil then the // PV is defined with a ClaimRef which includes the PVC's namespace. If the PVC is // nil then the PV is not defined with a ClaimRef. // **Note: the passed-in claim does not have a name until it is created (instantiated) // and thus the PV's ClaimRef cannot be completely filled-in in this func. Therefore, // the ClaimRef's name is added later in createPVandPVC(). </del> <ins> // Returns a PV definition based on the nfs server IP. If the PVC is not nil // then the PV is defined with a ClaimRef which includes the PVC's namespace. // If the PVC is nil then the PV is not defined with a ClaimRef. // Note: the passed-in claim does not have a name until it is created //   (instantiated) and thus the PV's ClaimRef cannot be completely filled-in in //   this func. Therefore, the ClaimRef's name is added later in //   createPVCPV. </ins> func makePersistentVolume(serverIP string, pvc *api.PersistentVolumeClaim) *api.PersistentVolume { // Specs are expected to match this test's PersistentVolumeClaim var claimRef *api.ObjectReference <del> claimRef = nil </del> if pvc != nil { claimRef = &api.ObjectReference{ Name:      pvc.Name,

Discussion:
Context: NodeSwap feature gate was recently . Currently, as per , swap is only supported with cgroup v2 - cgroup v1 is no longer supported. For this reason, we decided to fail kubelet if NodeSwap feature gate is enabled and the node runs with cgroup v1. This would help prevent any surprises for the user by failing as soon as possible. This effort is being implemented in this PR: The problem: Currently, swap jobs are running with cgroup v1. Swap tests were in a way that they first check on which environment they're being run (e.g. which cgroup version? is NodeSwap FG enabled? Which swapBehavior is defined? etc) and then expect the right behavior to take place. With v1, the tests expect the containers to be defined without swap access. While the tests pass, they are much less valuable, since all they check is that swap is disabled for v1 workloads. The tests would be much more valuable if they would run with v2, therefore actually ensure that proper swap limitations are configured. In addition, is dependent on these changes, since as of now the jobs immediately fail with this PR since kubelet fails on an environment with cgroup v1 and swap enabled. What needs to change: [x] CRI-O swap related jobs should be defined to run with cgroup v2 (e.g. ) [x] containerd swap related jobs should be defined to run with cgroup v2 (e.g. ). Future work: In the future, we might consider introducing more jobs to check swap. Ideally, both and would be tested, perhaps by periodic jobs.
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
/sig node
/sig testing
/reopen
Reopened this issue. <detailsIn response to : /reopen 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