mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 10:54:59 +00:00
Use socket instead of TCP for etcd config
When we make dummy test servers, we should make them using sockets for etcd rather than TCP ports so we don't run into problems like the test always failing if anything else is on that port already, which it can totally legitimately be. For instance, if you ran an existing featurebase server, and then tried "go test" in the server directory, this would fail.
This commit is contained in:
parent
36a4fb2cb7
commit
f066fcb33c
1 changed files with 5 additions and 0 deletions
|
|
@ -52,6 +52,11 @@ func newCommand(tb testing.TB, opts ...server.CommandOption) *Command {
|
|||
|
||||
m := &Command{commandOptions: opts}
|
||||
m.Command = server.NewCommand(bytes.NewReader(nil), ioutil.Discard, ioutil.Discard, opts...)
|
||||
// pick etcd ports using a socket rather than a real port
|
||||
err = GetPortsGenConfigs(tb, []*Command{m})
|
||||
if err != nil {
|
||||
tb.Fatalf("generating config: %v", err)
|
||||
}
|
||||
m.Config.DataDir = path
|
||||
defaultConf := server.NewConfig()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue