Skip to content

Commit

Permalink
fix: failing tset
Browse files Browse the repository at this point in the history
Signed-off-by: hlts2 <[email protected]>
  • Loading branch information
hlts2 committed Sep 3, 2020
1 parent 0938827 commit 1604bc9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
18 changes: 10 additions & 8 deletions internal/net/tcp/dialer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (
"net/http"
"net/http/httptest"
"reflect"
"strconv"
"strings"
"sync/atomic"
"testing"
Expand Down Expand Up @@ -789,6 +790,7 @@ func Test_dialer_StartDialerCache(t *testing.T) {
},
afterFunc: func(args) {
cancel()
time.Sleep(500 * time.Millisecond)
},
}
}(),
Expand Down Expand Up @@ -1045,7 +1047,7 @@ func Test_dialer_cachedDialer(t *testing.T) {
args: args{
dctx: context.Background(),
network: "tcp",
addr: addr + ":" + string(port),
addr: addr + ":" + strconv.FormatUint(uint64(port), 10),
},
fields: fields{
der: &net.Dialer{
Expand All @@ -1057,10 +1059,10 @@ func Test_dialer_cachedDialer(t *testing.T) {
dnsCache: true,
},
checkFunc: func(d *dialer, w want, gotConn net.Conn, err error) error {
if err == nil {
return errors.New("err is nil")
if err != nil {
return errors.New("err is not nil")
}
if gotConn != nil {
if gotConn == nil {
return errors.New("conn is nil")
}

Expand Down Expand Up @@ -1096,7 +1098,7 @@ func Test_dialer_cachedDialer(t *testing.T) {
args: args{
dctx: context.Background(),
network: "tcp",
addr: addr + ":" + string(port),
addr: addr + ":" + strconv.FormatUint(uint64(port), 10),
},
fields: fields{
der: &net.Dialer{
Expand All @@ -1109,10 +1111,10 @@ func Test_dialer_cachedDialer(t *testing.T) {
tlsConfig: new(tls.Config),
},
checkFunc: func(d *dialer, w want, gotConn net.Conn, err error) error {
if err == nil {
return errors.New("err is nil")
if err != nil {
return errors.New("err is not nil")
}
if gotConn != nil {
if gotConn == nil {
return errors.New("conn is nil")
}

Expand Down
2 changes: 1 addition & 1 deletion internal/worker/queue_option_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ func TestWithQueueCheckDuration(t *testing.T) {
},
want: want{
obj: new(T),
err: stderrors.New("time: invalid duration invalid"),
err: stderrors.New("time: invalid duration \"invalid\""),
},
},
}
Expand Down

0 comments on commit 1604bc9

Please sign in to comment.