From 4e069bd90e31de07acb80b7cc82ed91ebc32fa62 Mon Sep 17 00:00:00 2001 From: chenxingyu Date: Wed, 16 Aug 2017 14:59:37 +0800 Subject: [PATCH] fix panic in e2e --- test/e2e/scalability/load.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/e2e/scalability/load.go b/test/e2e/scalability/load.go index bee871e0722..a3bd0e991b0 100644 --- a/test/e2e/scalability/load.go +++ b/test/e2e/scalability/load.go @@ -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) {