From 1913850ec653f09eb2035bf65fc784ee1c63f26f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20BIDON?= Date: Fri, 19 Jun 2026 20:50:31 +0200 Subject: [PATCH] test(assertions): fixed flaky test (async w/real time) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make expectation more tolerant to jitter (incompressible when running on CI). * fixes #125 Signed-off-by: Frédéric BIDON --- .gitignore | 1 + .golangci.yml | 3 ++- internal/assertions/condition_synctest_test.go | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 872d1cd31..d7ba61e48 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ Godeps *.out .mcp.json go.work.sum +.worktrees diff --git a/.golangci.yml b/.golangci.yml index a01dcda3c..fcbf5a116 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -2,6 +2,7 @@ version: "2" linters: default: all disable: + - goconst # this linter has gone noisy. Disabled - depguard - err113 - funlen @@ -27,7 +28,7 @@ linters: dupl: threshold: 200 goconst: - min-len: 2 + min-len: 8 min-occurrences: 3 cyclop: max-complexity: 22 diff --git a/internal/assertions/condition_synctest_test.go b/internal/assertions/condition_synctest_test.go index 4c01a6c7d..414276e27 100644 --- a/internal/assertions/condition_synctest_test.go +++ b/internal/assertions/condition_synctest_test.go @@ -507,7 +507,7 @@ func dualEventuallyWithCompleteFalse(t *testing.T) { } expectedCalls := int(testTimeout / testTick) - if counter < expectedCalls-1 || counter > expectedCalls+1 { + if counter < expectedCalls-2 || counter > expectedCalls+1 { t.Errorf("expected %d calls, got %d", expectedCalls, counter) } }