update micro for default dial timeout fix
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
parent
1bef92eefa
commit
932636f4d5
2
go.mod
2
go.mod
@ -4,7 +4,7 @@ go 1.15
|
|||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/golang/protobuf v1.4.3
|
github.com/golang/protobuf v1.4.3
|
||||||
github.com/unistack-org/micro/v3 v3.0.0-gamma.0.20201105212509-72bbbe381783
|
github.com/unistack-org/micro/v3 v3.0.0-gamma.0.20201106081812-be8d09c66352
|
||||||
google.golang.org/grpc v1.31.1
|
google.golang.org/grpc v1.31.1
|
||||||
google.golang.org/protobuf v1.25.0
|
google.golang.org/protobuf v1.25.0
|
||||||
)
|
)
|
||||||
|
4
go.sum
4
go.sum
@ -279,8 +279,8 @@ github.com/unistack-org/micro/v3 v3.0.0-gamma/go.mod h1:iEtpu3wTYCRs3pQ3VsFEO7JB
|
|||||||
github.com/unistack-org/micro/v3 v3.0.0-gamma.0.20200909210629-caec730248b1/go.mod h1:mmqHR9WelHUXqg2mELjsQ+FJHcWs6mNmXg+wEYO2T3c=
|
github.com/unistack-org/micro/v3 v3.0.0-gamma.0.20200909210629-caec730248b1/go.mod h1:mmqHR9WelHUXqg2mELjsQ+FJHcWs6mNmXg+wEYO2T3c=
|
||||||
github.com/unistack-org/micro/v3 v3.0.0-gamma.0.20200920135754-1cbd1d2bad83/go.mod h1:HUzMG4Mcy97958VxWTg8zuazZgwQ/aoLZ8wtBVONwRE=
|
github.com/unistack-org/micro/v3 v3.0.0-gamma.0.20200920135754-1cbd1d2bad83/go.mod h1:HUzMG4Mcy97958VxWTg8zuazZgwQ/aoLZ8wtBVONwRE=
|
||||||
github.com/unistack-org/micro/v3 v3.0.0-gamma.0.20200922103357-4c4fa00a5d94/go.mod h1:aL+8VhSXpx0SuEeXPOWUo5BgS7kyvWYobeXFay90UUM=
|
github.com/unistack-org/micro/v3 v3.0.0-gamma.0.20200922103357-4c4fa00a5d94/go.mod h1:aL+8VhSXpx0SuEeXPOWUo5BgS7kyvWYobeXFay90UUM=
|
||||||
github.com/unistack-org/micro/v3 v3.0.0-gamma.0.20201105212509-72bbbe381783 h1:+wqZNIa2PZRndVP2mW+wY4gNGZ3ZHSHNZxlr2gMysrQ=
|
github.com/unistack-org/micro/v3 v3.0.0-gamma.0.20201106081812-be8d09c66352 h1:rtZrrpdVoF7zz93N8vsx5evDC4g5AU46tkdPeTGOQMk=
|
||||||
github.com/unistack-org/micro/v3 v3.0.0-gamma.0.20201105212509-72bbbe381783/go.mod h1:LFvCXGOgcLIj2k/8eL71TpIpcJBN2SXXAUx8U6dz9Rw=
|
github.com/unistack-org/micro/v3 v3.0.0-gamma.0.20201106081812-be8d09c66352/go.mod h1:LFvCXGOgcLIj2k/8eL71TpIpcJBN2SXXAUx8U6dz9Rw=
|
||||||
github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
|
github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
|
||||||
github.com/vultr/govultr v0.1.4/go.mod h1:9H008Uxr/C4vFNGLqKx232C206GL0PBHzOP0809bGNA=
|
github.com/vultr/govultr v0.1.4/go.mod h1:9H008Uxr/C4vFNGLqKx232C206GL0PBHzOP0809bGNA=
|
||||||
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
|
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
|
||||||
|
17
grpc_test.go
17
grpc_test.go
@ -1,6 +1,7 @@
|
|||||||
package grpc
|
package grpc
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"net"
|
"net"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
@ -21,20 +22,20 @@ func expectedPort(t *testing.T, expected string, lsn transport.Listener) {
|
|||||||
|
|
||||||
func TestGRPCTransportPortRange(t *testing.T) {
|
func TestGRPCTransportPortRange(t *testing.T) {
|
||||||
tp := NewTransport()
|
tp := NewTransport()
|
||||||
|
ctx := context.TODO()
|
||||||
lsn1, err := tp.Listen(":44444-44448")
|
lsn1, err := tp.Listen(ctx, ":44444-44448")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf("Did not expect an error, got %s", err)
|
t.Errorf("Did not expect an error, got %s", err)
|
||||||
}
|
}
|
||||||
expectedPort(t, "44444", lsn1)
|
expectedPort(t, "44444", lsn1)
|
||||||
|
|
||||||
lsn2, err := tp.Listen(":44444-44448")
|
lsn2, err := tp.Listen(ctx, ":44444-44448")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf("Did not expect an error, got %s", err)
|
t.Errorf("Did not expect an error, got %s", err)
|
||||||
}
|
}
|
||||||
expectedPort(t, "44445", lsn2)
|
expectedPort(t, "44445", lsn2)
|
||||||
|
|
||||||
lsn, err := tp.Listen(":0")
|
lsn, err := tp.Listen(ctx, ":0")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf("Did not expect an error, got %s", err)
|
t.Errorf("Did not expect an error, got %s", err)
|
||||||
}
|
}
|
||||||
@ -46,8 +47,8 @@ func TestGRPCTransportPortRange(t *testing.T) {
|
|||||||
|
|
||||||
func TestGRPCTransportCommunication(t *testing.T) {
|
func TestGRPCTransportCommunication(t *testing.T) {
|
||||||
tr := NewTransport()
|
tr := NewTransport()
|
||||||
|
ctx := context.Background()
|
||||||
l, err := tr.Listen(":0")
|
l, err := tr.Listen(ctx, ":0")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf("Unexpected listen err: %v", err)
|
t.Errorf("Unexpected listen err: %v", err)
|
||||||
}
|
}
|
||||||
@ -80,9 +81,9 @@ func TestGRPCTransportCommunication(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
c, err := tr.Dial(l.Addr())
|
c, err := tr.Dial(ctx, l.Addr())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf("Unexpected dial err: %v", err)
|
t.Fatalf("Unexpected dial err: %v", err)
|
||||||
}
|
}
|
||||||
defer c.Close()
|
defer c.Close()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user