From c0627dc80d66397747d6f5aa7210649b9906e5fc Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Mon, 1 May 2023 17:18:19 +0200 Subject: [PATCH] check: Fix flaky TestCheckerModifiedData The test had a 4% chance of not modified the data read from the repository, in which case the test would fail. Change the data manipulation to just modified each read operation. --- internal/checker/checker_test.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/internal/checker/checker_test.go b/internal/checker/checker_test.go index 775484652..6405ecfbd 100644 --- a/internal/checker/checker_test.go +++ b/internal/checker/checker_test.go @@ -331,10 +331,6 @@ func (erd errorReadCloser) Read(p []byte) (int, error) { // induceError flips a bit in the slice. func induceError(data []byte) { - if rand.Float32() < 0.2 { - return - } - pos := rand.Intn(len(data)) data[pos] ^= 1 }