-
Notifications
You must be signed in to change notification settings - Fork 591
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tests: flag grpc sandbox for unit tests #1149
Conversation
@stephenplusplus I'm not really sure if this is the way to go, so your guidance is very welcome here :) |
Has this made a difference locally? |
Yep, locally I'm all green with this. |
What was the error that was happening without this change? |
We're seeing consistent failures with v0.12.x in regards to https://travis-ci.org/GoogleCloudPlatform/gcloud-node/jobs/113138184 |
Related: #1140 |
Is this an issue with the PubSub gRPC service? or something about our testing environment? Ideally.. our tests run both gRPC and the non-gRPC paths so we know if there are problems.... right ? |
Yes, I sadly know about that |
Looks to be our testing environment.
Locally I was also receiving this error 1) PubSub subscribe should create a Topic object from a string:
Uncaught Error: .google.pubsub.v1.Subscription#a is not a field: undefined
at Error (native)
at MessagePrototype.set (node_modules/grpc/node_modules/protobufjs/dist/ProtoBuf.js:2440:58)
at MessagePrototype.set (node_modules/grpc/node_modules/protobufjs/dist/ProtoBuf.js:2434:38)
at Message (node_modules/grpc/node_modules/protobufjs/dist/ProtoBuf.js:2363:34)
at serialize (node_modules/grpc/src/node/src/common.js:76:23)
at Client.makeUnaryRequest [as createSubscription] (node_modules/grpc/src/node/src/client.js:303:19)
at PubSub.GrpcService.request (lib/common/grpc-service.js:214:28)
at lib/common/grpc-service.js:187:12
at lib/common/grpc-service.js:285:5
at addScope (node_modules/google-auto-auth/index.js:74:5)
at callback (node_modules/google-auto-auth/node_modules/google-auth-library/lib/auth/googleauth.js:41:5)
at node_modules/google-auto-auth/node_modules/google-auth-library/lib/auth/googleauth.js:124:9 Also after flagging |
Okay, lets just patch that hole up. We shouldn't be letting requests slip through to GrpcService. |
Sorry, just to make sure I understand -- these are "should be mocked" methods, right? For system tests, do we send live requests both via HTTP/1.1 and gRPC? |
In our system tests, we send real requests through the gRPC library, which does... whatever it does. In unit tests, we mock requests. But @callmehiphop caught a place where we were letting a unit test slip through to the real API. |
SGTM. Ignore the noise. :)
|
Since I haven't been able to reproduce this error locally, I don't really know how to fix it. Maybe if we didn't actually inherit from the class with our |
Isn't the reason |
Just unit testing principles. We shouldn't have leaks in our unit tests. On Thu, Mar 3, 2016, 1:12 PM Dave Gramlich notifications@github.com wrote:
|
Fair enough, I'll close this PR then! |
Okay, are you going to try to fix the leak you found? I'm kind of leaning on you for that, since I can't reproduce. |
I hadn't planned on it, I believe that error is directly related to #1140 which still needs fixing. Have you tried testing with |
Closes #1140
We've been seeing some test failures since moving PubSub to gRPC. This PR will stop any gRPC calls from actually being made in our unit tests.