From 10eb23bd6b0d3f4b4207e7af701fef85c1bd5fee Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Tue, 14 May 2024 17:45:39 +0100 Subject: [PATCH] [TEST] Rules: Sleep 15ms to fit Windows behaviour better On Windows, Go will sleep 15ms if you ask for less. TestAsyncRuleEvaluation compares actual delay to the nominal time, so using 15ms should work better on Windows, and be hardly noticeable elsewhere. Signed-off-by: Bryan Boreham --- rules/manager_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rules/manager_test.go b/rules/manager_test.go index 1862b5807..94d0755f9 100644 --- a/rules/manager_test.go +++ b/rules/manager_test.go @@ -2043,7 +2043,7 @@ func TestBoundedRuleEvalConcurrency(t *testing.T) { require.EqualValues(t, maxInflight.Load(), int32(maxConcurrency)+int32(groupCount)) } -const artificialDelay = 10 * time.Millisecond +const artificialDelay = 15 * time.Millisecond func optsFactory(storage storage.Storage, maxInflight, inflightQueries *atomic.Int32, maxConcurrent int64) *ManagerOptions { var inflightMu sync.Mutex