From 8281a6aa9eb3b592a59fb4b449a033341efc7b67 Mon Sep 17 00:00:00 2001 From: Dmitry Verkhoturov Date: Wed, 19 Aug 2026 06:09:58 +0100 Subject: [PATCH] drop wall-clock assertions from TestPoolPerf each pool configuration was asserted to finish faster than a one-off errgroup baseline measured in the same run, which fails whenever the machine is loaded: seen locally at 3.71s against a 3.37s baseline, roughly one run in five. the timings are still logged, and BenchmarkPoolCompare already covers the comparison properly. the correctness assertions are untouched. --- bench_test.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/bench_test.go b/bench_test.go index ee66f90..c372542 100644 --- a/bench_test.go +++ b/bench_test.go @@ -34,12 +34,10 @@ func TestPoolPerf(t *testing.T) { n := 1000 ctx := context.Background() - var egDuration time.Duration t.Run("errgroup", func(t *testing.T) { var count2 atomic.Int32 st := time.Now() defer func() { - egDuration = time.Since(st) t.Logf("elapsed errgroup: %v", time.Since(st)) }() g, _ := errgroup.WithContext(ctx) @@ -76,7 +74,6 @@ func TestPoolPerf(t *testing.T) { require.NoError(t, p.Wait(ctx)) assert.Equal(t, int32(1000000), count1.Load()) t.Logf("elapsed pool: %v", time.Since(st)) - assert.Less(t, time.Since(st), egDuration) }) t.Run("pool with 100 chan size", func(t *testing.T) { @@ -100,7 +97,6 @@ func TestPoolPerf(t *testing.T) { require.NoError(t, p.Wait(ctx)) assert.Equal(t, int32(1000000), count1.Load()) t.Logf("elapsed pool: %v", time.Since(st)) - assert.Less(t, time.Since(st), egDuration) }) t.Run("pool with 100 chan size and 100 batch size", func(t *testing.T) { @@ -124,7 +120,6 @@ func TestPoolPerf(t *testing.T) { require.NoError(t, p.Wait(ctx)) assert.Equal(t, int32(1000000), count1.Load()) t.Logf("elapsed pool: %v", time.Since(st)) - assert.Less(t, time.Since(st), egDuration) }) t.Run("pool with 100 chan size and 100 batch size and chunking", func(t *testing.T) { @@ -150,7 +145,6 @@ func TestPoolPerf(t *testing.T) { require.NoError(t, p.Wait(ctx)) assert.Equal(t, int32(1000000), count1.Load()) t.Logf("elapsed pool: %v", time.Since(st)) - assert.Less(t, time.Since(st), egDuration) }) }