Skip to content

Commit

Permalink
fix: fix acceptor test in windows
Browse files Browse the repository at this point in the history
  • Loading branch information
felipejfc committed Sep 13, 2023
1 parent d875e51 commit 2ef50f2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions acceptor/tcp_acceptor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ package acceptor

import (
"net"
"runtime"
"testing"
"time"

Expand Down Expand Up @@ -49,6 +50,9 @@ func TestNewTCPAcceptorGetConnChanAndGetAddr(t *testing.T) {
for _, table := range tcpAcceptorTables {
t.Run(table.name, func(t *testing.T) {
if table.panicErr != "" {
if table.name == "test_4" && runtime.GOOS == "windows" {
table.panicErr = "invalid certificates: open wqd: The system cannot find the file specified."
}
assert.PanicsWithError(t, table.panicErr, func() {
NewTCPAcceptor(table.addr, table.certs...)
})
Expand Down
4 changes: 2 additions & 2 deletions helpers/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ import (
"testing"
"time"

clientv3 "go.etcd.io/etcd/client/v3"
"go.etcd.io/etcd/tests/v3/integration"
"github.com/nats-io/nats-server/v2/server"
gnatsd "github.com/nats-io/nats-server/v2/test"
clientv3 "go.etcd.io/etcd/client/v3"
"go.etcd.io/etcd/tests/v3/integration"
)

// GetFreePort returns a free port
Expand Down

0 comments on commit 2ef50f2

Please sign in to comment.