Change:
pull-kubernetes-unit reconciler TestRunOneVolumeDetachFailNodeWithReadWriteOnce unknown, maybe recently? No response /sig storage
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 test is still flaking but it is almost rare. Please see the link below for the test history. The root cause is that the detach operation is not triggered or completed within 100ms. 1) not triggered: 2) triggered but not completed: It seems no better way to fix it unless we increase sleep time in the test. i.e. (100ms -200ms) I'm not sure if it is valuable to fix it. cc what do you think?
any flake should be fixed even if it's rare.
/assign

Discussion:
if podAddErr != nil { t.Fatalf("AddPod failed. Expected: <no error> Actual: <%v>", podAddErr) } <del> waitForVolumeAttachedToNode(t, generatedVolumeName, nodeName2, asw) verifyVolumeAttachedToNode(t, generatedVolumeName, nodeName2, cache.AttachStateAttached, asw) </del> <ins> waitForVolumeAttachStateToNode(t, generatedVolumeName, nodeName2, cache.AttachStateAttached, asw) </ins> } func Test_Run_UpdateNodeStatusFailBeforeOneVolumeDetachNodeWithReadWriteOnce(t *testing.T) {

// Delete the pod, but detach will fail dsw.DeletePod(types.UniquePodName(podName1), generatedVolumeName, nodeName1) <del> // The first detach will be triggered after at least 50ms (maxWaitForUnmountDuration in test). // Right before detach operation is performed, the volume will be first removed from being reported // as attached on node status (RemoveVolumeFromReportAsAttached). After detach operation which is expected to fail, // controller then treats the attachment as Uncertain. // Here it sleeps 100ms so that detach should be triggered already at this point. time.Sleep(100 * time.Millisecond) verifyVolumeAttachedToNode(t, generatedVolumeName, nodeName1, cache.AttachStateUncertain, asw) </del> <ins> waitForVolumeAttachStateToNode(t, generatedVolumeName, nodeName1, cache.AttachStateUncertain, asw) </ins> verifyVolumeReportedAsAttachedToNode(t, logger, generatedVolumeName, nodeName1, false, asw, volumeAttachedCheckTimeout) // Add a second pod which tries to attach the volume to the same node.

if podAddErr != nil { t.Fatalf("AddPod failed. Expected: <no error> Actual: <%v>", podAddErr) } <del> waitForVolumeAttachedToNode(t, generatedVolumeName, nodeName2, asw) verifyVolumeAttachedToNode(t, generatedVolumeName, nodeName2, cache.AttachStateAttached, asw) </del> <ins> waitForVolumeAttachStateToNode(t, generatedVolumeName, nodeName2, cache.AttachStateAttached, asw) </ins> } // Populates desiredStateOfWorld cache with one node/volume/pod tuple.

} } <del> func waitForVolumeAttachedToNode( </del> <ins> func waitForVolumeAttachStateToNode( </ins> t *testing.T, volumeName v1.UniqueVolumeName, nodeName k8stypes.NodeName, <ins> expectedAttachState cache.AttachState, </ins> asw cache.ActualStateOfWorld) { err := retryWithExponentialBackOff( time.Duration(500*time.Millisecond), func() (bool, error) { attachState := asw.GetAttachState(volumeName, nodeName) <del> if attachState == cache.AttachStateAttached { </del> <ins> if attachState == expectedAttachState { </ins> return true, nil } <del> t.Logf( "Warning: Volume <%v> is not attached to node  <%v> yet. Will retry.", volumeName, nodeName) </del> <ins> t.Logf("Warning: expected attach state: %v, actual attach state: %v. Will retry.", expectedAttachState, attachState) </ins> return false, nil }, ) attachState := asw.GetAttachState(volumeName, nodeName) <del> if err != nil && attachState != cache.AttachStateAttached { t.Fatalf( "Volume <%v> is not attached to node  <%v>.", volumeName, nodeName) </del> <ins> if err != nil && attachState != expectedAttachState { t.Fatalf("Volume <%v> is not in expected attach state: %v, actual attach state: %v", volumeName, expectedAttachState, attachState) </ins> } <ins> t.Logf("Volume <%v> is attached to node <%v>: %v", volumeName, nodeName, expectedAttachState) </ins> } func waitForVolumeAddedToNode(