Skip to content

Commit

Permalink
fix: build error of internal kvs test (#2396) (#2398)
Browse files Browse the repository at this point in the history
Signed-off-by: hlts2 <hiroto.funakoshi.hiroto@gmail.com>
Co-authored-by: Hiroto Funakoshi <hiroto.funakoshi.hiroto@gmail.com>
  • Loading branch information
vdaas-ci and hlts2 committed Feb 21, 2024
1 parent dd7be4c commit 92032a6
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 92032a6

Please sign in to comment.