Fix flake for volume detach metrics

This commit is contained in:
Hemant Kumar 2017-10-10 11:29:41 -04:00
parent 46c2bfe47d
commit 6f0c98bed8

View File

@ -100,7 +100,7 @@ var _ = SIGDescribe("[Serial] Volume metrics", func() {
backoff := wait.Backoff{ backoff := wait.Backoff{
Duration: 10 * time.Second, Duration: 10 * time.Second,
Factor: 1.2, Factor: 1.2,
Steps: 3, Steps: 21,
} }
updatedStorageMetrics := make(map[string]int64) updatedStorageMetrics := make(map[string]int64)
@ -113,7 +113,11 @@ var _ = SIGDescribe("[Serial] Volume metrics", func() {
return false, err return false, err
} }
updatedStorageMetrics = getControllerStorageMetrics(updatedMetrics) updatedStorageMetrics = getControllerStorageMetrics(updatedMetrics)
if len(updatedStorageMetrics) == 0 { metricCount := len(updatedStorageMetrics)
// Usually a pod deletion does not mean immediate volume detach
// we will have to retry to verify volume_detach metrics
_, detachMetricFound := updatedStorageMetrics["volume_detach"]
if metricCount < 3 || !detachMetricFound {
framework.Logf("Volume metrics not collected yet, going to retry") framework.Logf("Volume metrics not collected yet, going to retry")
return false, nil return false, nil
} }