From 050dddae1ecb2a16ad46729c8482c07e62b4a689 Mon Sep 17 00:00:00 2001 From: Marco Pracucci Date: Wed, 28 Apr 2021 17:09:58 +0200 Subject: [PATCH] Fix TestStreamWriteYAMLResponse flakyness (#4122) Signed-off-by: Marco Pracucci --- pkg/util/http_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/util/http_test.go b/pkg/util/http_test.go index 746a1bfa34..fcc2076a93 100644 --- a/pkg/util/http_test.go +++ b/pkg/util/http_test.go @@ -108,7 +108,9 @@ func TestStreamWriteYAMLResponse(t *testing.T) { expectedContentType: "application/yaml", value: make(map[string]*testStruct), } - for i := 0; i < rand.Intn(100); i++ { + + // Generate some data to serialize. + for i := 0; i < rand.Intn(100)+1; i++ { ts := testStruct{ Name: "testName" + strconv.Itoa(i), Value: i,