From 1d6d613add63c9ed6f68934b283c769a44abc152 Mon Sep 17 00:00:00 2001 From: Hiroto Funakoshi Date: Wed, 21 Feb 2024 12:28:11 +0900 Subject: [PATCH] fix: build error of internal kvs test (#2396) Signed-off-by: hlts2 --- pkg/agent/internal/kvs/kvs_test.go | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/pkg/agent/internal/kvs/kvs_test.go b/pkg/agent/internal/kvs/kvs_test.go index 0849e921ea..c35fd31e39 100644 --- a/pkg/agent/internal/kvs/kvs_test.go +++ b/pkg/agent/internal/kvs/kvs_test.go @@ -26,7 +26,6 @@ import ( "github.com/vdaas/vald/internal/errors" "github.com/vdaas/vald/internal/sync" - "github.com/vdaas/vald/internal/sync/errgroup" "github.com/vdaas/vald/internal/test/goleak" ) @@ -35,8 +34,12 @@ func TestNew(t *testing.T) { type want struct { want BidiMap } + type args struct { + opts []Option + } type test struct { name string + args args want want checkFunc func(want, BidiMap) error beforeFunc func() @@ -58,11 +61,17 @@ func TestNew(t *testing.T) { wantOu[i] = new(sync.Map[uint32, valueStructOu]) wantUo[i] = new(sync.Map[string, ValueStructUo]) } + concurrency := runtime.GOMAXPROCS(-1) * 10 return test{ name: "return the bidi struct", + args: args{ + opts: []Option{ + WithConcurrency(concurrency), + }, + }, want: want{ want: &bidi{ - concurrency: runtime.GOMAXPROCS(-1) * 10, + concurrency: concurrency, l: 0, ou: wantOu, uo: wantUo, @@ -89,7 +98,7 @@ func TestNew(t *testing.T) { checkFunc = defaultCheckFunc } - got := New(WithErrGroup(errgroup.Get())) + got := New(test.args.opts...) if err := checkFunc(test.want, got); err != nil { tt.Errorf("error = %v", err) }