From e006ad6bd2047dd690d48704ce2c84acec1aab92 Mon Sep 17 00:00:00 2001 From: Tim Vaillancourt Date: Sat, 11 May 2024 03:22:36 +0200 Subject: [PATCH] improve testing Signed-off-by: Tim Vaillancourt --- go/streamlog/streamlog_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/go/streamlog/streamlog_test.go b/go/streamlog/streamlog_test.go index 1a703cdf2e5..63beb2e48b1 100644 --- a/go/streamlog/streamlog_test.go +++ b/go/streamlog/streamlog_test.go @@ -272,6 +272,10 @@ func TestShouldSampleQuery(t *testing.T) { queryLogSampleRate = 0 assert.False(t, shouldSampleQuery()) + // for test coverage, can't test a random result + queryLogSampleRate = 0.5 + shouldSampleQuery() + queryLogSampleRate = 1.0 assert.True(t, shouldSampleQuery())