Skip to content

Commit

Permalink
fix: memberlist tries to get a busy port
Browse files Browse the repository at this point in the history
  • Loading branch information
buraksezer committed Dec 9, 2020
1 parent e1990cd commit d1b4823
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmd/olric-cli/cli/evaluate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"github.com/buraksezer/olric"
"github.com/buraksezer/olric/client"
"github.com/buraksezer/olric/config"
"github.com/hashicorp/memberlist"
)

var testConfig = &client.Config{
Expand All @@ -50,6 +51,10 @@ func newDB() (*olric.Olric, chan struct{}, error) {
if err != nil {
return nil, nil, err
}

mc := memberlist.DefaultLocalConfig()
mc.BindPort = 0

cfg := &config.Config{
PartitionCount: 7,
BindAddr: "127.0.0.1",
Expand All @@ -58,6 +63,7 @@ func newDB() (*olric.Olric, chan struct{}, error) {
WriteQuorum: config.MinimumReplicaCount,
ReadQuorum: config.MinimumReplicaCount,
MemberCountQuorum: config.MinimumMemberCountQuorum,
MemberlistConfig: mc,
}
db, err := olric.New(cfg)
if err != nil {
Expand Down

0 comments on commit d1b4823

Please sign in to comment.