func waitForDetach(
	t *testing.T,
	fakePlugin *volumetesting.FakeVolumePlugin,
	asw cache.ActualStateOfWorld) {
	err := retryWithExponentialBackOff(
		time.Duration(5*time.Millisecond),
		func() (bool, error) {
			attachedVolumes := asw.GetAttachedVolumes()
			if len(attachedVolumes) == 0 {
				return true, nil
			}

			return false, nil
		},
	)

	if err != nil {
		t.Fatalf("Timed out waiting for len of asw.attachedVolumes() to become zero.")
	}
}