Merge pull request #50742 from WIZARD-CXY/fixpanicine2e

Automatic merge from submit-queue (batch tested with PRs 50711, 50742, 50204)

fix panic in e2e

**What this PR does / why we need it**:
fix #50660 
**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

**Special notes for your reviewer**:
no
**Release note**:

```release-note

none
```
This commit is contained in:
Kubernetes Submit Queue 2017-08-16 02:50:24 -07:00 committed by GitHub
commit bc2bb37fa9

View File

@ -518,7 +518,9 @@ func generateServicesForConfigs(configs []testutils.RunObjectConfig) []*v1.Servi
}
func sleepUpTo(d time.Duration) {
time.Sleep(time.Duration(rand.Int63n(d.Nanoseconds())))
if d.Nanoseconds() > 0 {
time.Sleep(time.Duration(rand.Int63n(d.Nanoseconds())))
}
}
func createAllResources(configs []testutils.RunObjectConfig, creatingTime time.Duration) {