THRIFT-4421 golang tests rely on gomock, which has changed behaviour, causing tests to fail
Client: go
This closes #1443
diff --git a/lib/go/test/tests/client_error_test.go b/lib/go/test/tests/client_error_test.go
index 4a8ef13..5dec472 100644
--- a/lib/go/test/tests/client_error_test.go
+++ b/lib/go/test/tests/client_error_test.go
@@ -414,6 +414,7 @@
client := errortest.NewErrorTestClient(thrift.NewTStandardClient(protocol, protocol))
_, retErr := client.TestStruct(defaultCtx, thing)
mockCtrl.Finish()
+ mockCtrl = gomock.NewController(t)
err2, ok := retErr.(thrift.TTransportException)
if !ok {
t.Fatal("Expected a TTrasportException")
@@ -446,6 +447,7 @@
client := errortest.NewErrorTestClientProtocol(transport, protocol, protocol)
_, retErr := client.TestStruct(defaultCtx, thing)
mockCtrl.Finish()
+ mockCtrl = gomock.NewController(t)
err2, ok := retErr.(thrift.TTransportException)
if !ok {
t.Fatal("Expected a TTrasportException")
@@ -477,6 +479,7 @@
client := errortest.NewErrorTestClient(thrift.NewTStandardClient(protocol, protocol))
_, retErr := client.TestStruct(defaultCtx, thing)
mockCtrl.Finish()
+ mockCtrl = gomock.NewController(t)
err2, ok := retErr.(thrift.TProtocolException)
if !ok {
t.Fatal("Expected a TProtocolException")
@@ -508,6 +511,7 @@
client := errortest.NewErrorTestClientProtocol(transport, protocol, protocol)
_, retErr := client.TestStruct(defaultCtx, thing)
mockCtrl.Finish()
+ mockCtrl = gomock.NewController(t)
err2, ok := retErr.(thrift.TProtocolException)
if !ok {
t.Fatal("Expected a TProtocolException")
@@ -628,6 +632,7 @@
client := errortest.NewErrorTestClient(thrift.NewTStandardClient(protocol, protocol))
_, retErr := client.TestString(defaultCtx, "test")
mockCtrl.Finish()
+ mockCtrl = gomock.NewController(t)
if !willComplete {
err2, ok := retErr.(thrift.TTransportException)
@@ -663,6 +668,7 @@
client := errortest.NewErrorTestClientProtocol(transport, protocol, protocol)
_, retErr := client.TestString(defaultCtx, "test")
mockCtrl.Finish()
+ mockCtrl = gomock.NewController(t)
if !willComplete {
err2, ok := retErr.(thrift.TTransportException)
diff --git a/lib/go/test/tests/required_fields_test.go b/lib/go/test/tests/required_fields_test.go
index 2053712..287ef60 100644
--- a/lib/go/test/tests/required_fields_test.go
+++ b/lib/go/test/tests/required_fields_test.go
@@ -40,6 +40,7 @@
err := testStruct.Read(protocol)
mockCtrl.Finish()
+ mockCtrl = gomock.NewController(t)
if err == nil {
t.Fatal("Expected read to fail")
}
@@ -63,6 +64,7 @@
err = testStruct.Read(protocol)
mockCtrl.Finish()
+ mockCtrl = gomock.NewController(t)
if err == nil {
t.Fatal("Expected read to fail")
}