Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport PR #2396 to release/v1.7 for Bugfix: Build error of pkg/internal/ kvs test #2398

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading