Skip to content

Commit

Permalink
fix: build error of internal kvs test (#2396)
Browse files Browse the repository at this point in the history
Signed-off-by: hlts2 <[email protected]>
  • Loading branch information
hlts2 authored and vdaas-ci committed Feb 21, 2024
1 parent dd7be4c commit 1d6d613
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions pkg/agent/internal/kvs/kvs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand All @@ -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()
Expand All @@ -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,
Expand All @@ -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)
}
Expand Down

0 comments on commit 1d6d613

Please sign in to comment.