mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 14:37:00 +00:00
Fix #14284: TestPersistentVolumeClaimBinder flake
This commit is contained in:
parent
2e5a3cfbc6
commit
cd56b041f3
@ -86,16 +86,18 @@ func TestPersistentVolumeClaimBinder(t *testing.T) {
|
||||
}
|
||||
defer watch.Stop()
|
||||
|
||||
boundCount := 0
|
||||
expectedBoundCount := 2
|
||||
for {
|
||||
// Wait for claim01 and claim02 to become bound
|
||||
claim01Pending := true
|
||||
claim02Pending := true
|
||||
for claim01Pending || claim02Pending {
|
||||
event := <-watch.ResultChan()
|
||||
claim := event.Object.(*api.PersistentVolumeClaim)
|
||||
if claim.Spec.VolumeName != "" {
|
||||
boundCount++
|
||||
}
|
||||
if boundCount == expectedBoundCount {
|
||||
break
|
||||
if claim.Spec.VolumeName != "" && claim.Status.Phase != "Bound" {
|
||||
if claim.Name == "claim01" {
|
||||
claim01Pending = false
|
||||
} else if claim.Name == "claim02" {
|
||||
claim02Pending = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user