Not sure what you mean by "backwards compatible", but (a) this change affects only tests
(b) the reason it's needed is that the golang tests pull in gomock, but without a specific version. So anybody who runs tests starting .... 11/28 is going to pull in the new gomock, and need this patch, I would think. --chet-- On Tue, Dec 12, 2017 at 1:15 PM, James E. King, III <[email protected]> wrote: > Hi Chet, > > I don't know go that well, but I appreciate your effort on go and rust > lately - thank you. > In terms of this, as long as it's backwards compatible then I think we're > good. > > - Jim > > On Tue, Dec 12, 2017 at 3:56 PM, Chet Murthy <[email protected]> > wrote: > > > Synopsis: "make check" in lib/go fails b/c gomock no longer allows > multiple > > Finish() calls on a gomock Controller. that change was made on 11/28/17. > > > > I'm just finishing a PR that will fix this, but figured maybe I should > post > > it too. As you can see, it's pretty simplistic -- just reNew the > mockCtrl > > in every place it's Finish()ed. > > > > --chet-- > > 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 @@ func TestClientReportTTransportErrors(t *testing.T) > { > > 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 @@ func TestClientReportTTransportErrorsLegacy(t > > *testing.T) { > > 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 @@ func TestClientReportTProtocolErrors(t *testing.T) { > > 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 @@ func TestClientReportTProtocolErrorsLegacy(t > > *testing.T) { > > 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 @@ func TestClientCallException(t *testing.T) { > > 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 @@ func TestClientCallExceptionLegacy(t *testing.T) { > > 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..7b2a628 100644 > > --- a/lib/go/test/tests/required_fields_test.go > > +++ b/lib/go/test/tests/required_fields_test.go > > @@ -40,6 +40,7 @@ func TestStructReadRequiredFields(t *testing.T) { > > > > err := testStruct.Read(protocol) > > mockCtrl.Finish() > > + mockCtrl = gomock.NewController(t) > > if err == nil { > > t.Fatal("Expected read to fail") > > } > > @@ -63,6 +64,7 @@ func TestStructReadRequiredFields(t *testing.T) { > > > > err = testStruct.Read(protocol) > > mockCtrl.Finish() > > + mockCtrl = gomock.NewController(t) > > if err == nil { > > t.Fatal("Expected read to fail") > > } > > @@ -89,6 +91,7 @@ func TestStructReadRequiredFields(t *testing.T) { > > > > err = testStruct.Read(protocol) > > mockCtrl.Finish() > > + mockCtrl = gomock.NewController(t) > > if err != nil { > > t.Fatal("Expected read to succeed") > > } > > >
