Merge pull request #93658 from dcbw/csi-fail-test-on-close

test/e2e: fail test rather than flooding logs if PVC watch is closed prematurely
This commit is contained in:
Kubernetes Prow Robot 2020-08-04 18:08:42 -07:00 committed by GitHub
commit 56c76023f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -892,7 +892,11 @@ var _ = utils.SIGDescribe("CSI mock volume", func() {
loop:
for {
select {
case event := <-pvcWatch.ResultChan():
case event, ok := <-pvcWatch.ResultChan():
if !ok {
framework.Failf("PVC watch ended prematurely")
}
framework.Logf("PVC event %s: %#v", event.Type, event.Object)
switch event.Type {
case watch.Modified: