diff --git a/go.mod b/go.mod index 7eb59e4..83be56f 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.15 require ( 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/protobuf v1.25.0 ) diff --git a/go.sum b/go.sum index 9e327db..984392a 100644 --- a/go.sum +++ b/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.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.20201105212509-72bbbe381783 h1:+wqZNIa2PZRndVP2mW+wY4gNGZ3ZHSHNZxlr2gMysrQ= -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 h1:rtZrrpdVoF7zz93N8vsx5evDC4g5AU46tkdPeTGOQMk= +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/vultr/govultr v0.1.4/go.mod h1:9H008Uxr/C4vFNGLqKx232C206GL0PBHzOP0809bGNA= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= diff --git a/grpc_test.go b/grpc_test.go index 3d2b095..2ee7b93 100644 --- a/grpc_test.go +++ b/grpc_test.go @@ -1,6 +1,7 @@ package grpc import ( + "context" "net" "testing" @@ -21,20 +22,20 @@ func expectedPort(t *testing.T, expected string, lsn transport.Listener) { func TestGRPCTransportPortRange(t *testing.T) { tp := NewTransport() - - lsn1, err := tp.Listen(":44444-44448") + ctx := context.TODO() + lsn1, err := tp.Listen(ctx, ":44444-44448") if err != nil { t.Errorf("Did not expect an error, got %s", err) } expectedPort(t, "44444", lsn1) - lsn2, err := tp.Listen(":44444-44448") + lsn2, err := tp.Listen(ctx, ":44444-44448") if err != nil { t.Errorf("Did not expect an error, got %s", err) } expectedPort(t, "44445", lsn2) - lsn, err := tp.Listen(":0") + lsn, err := tp.Listen(ctx, ":0") if err != nil { t.Errorf("Did not expect an error, got %s", err) } @@ -46,8 +47,8 @@ func TestGRPCTransportPortRange(t *testing.T) { func TestGRPCTransportCommunication(t *testing.T) { tr := NewTransport() - - l, err := tr.Listen(":0") + ctx := context.Background() + l, err := tr.Listen(ctx, ":0") if err != nil { 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 { - t.Errorf("Unexpected dial err: %v", err) + t.Fatalf("Unexpected dial err: %v", err) } defer c.Close()