From ec9640c612fcbb0e19ec971dd1dc7a9efb2e6c7d Mon Sep 17 00:00:00 2001 From: Stephen Sawchuk Date: Tue, 8 Mar 2016 11:53:31 -0500 Subject: [PATCH] patch gRPC leaks in Pub/Sub unit test --- test/pubsub/index.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/test/pubsub/index.js b/test/pubsub/index.js index 2a0ee67dec5..879ed83b69d 100644 --- a/test/pubsub/index.js +++ b/test/pubsub/index.js @@ -20,9 +20,7 @@ var arrify = require('arrify'); var assert = require('assert'); var extend = require('extend'); var mockery = require('mockery-next'); -var nodeutil = require('util'); -var GrpcService = require('../../lib/common/grpc-service.js'); var Topic = require('../../lib/pubsub/topic.js'); var util = require('../../lib/common/util.js'); @@ -38,11 +36,8 @@ var fakeUtil = extend({}, util); function FakeGrpcService() { this.calledWith_ = arguments; - GrpcService.apply(this, arguments); } -nodeutil.inherits(FakeGrpcService, GrpcService); - var extended = false; var fakeStreamRouter = { extend: function(Class, methods) { @@ -93,6 +88,7 @@ describe('PubSub', function() { beforeEach(function() { SubscriptionOverride = null; pubsub = new PubSub(OPTIONS); + pubsub.projectId = PROJECT_ID; }); describe('instantiation', function() { @@ -120,7 +116,7 @@ describe('PubSub', function() { }); it('should inherit from GrpcService', function() { - assert(pubsub instanceof GrpcService); + assert(pubsub instanceof FakeGrpcService); var calledWith = pubsub.calledWith_[0]; @@ -495,6 +491,8 @@ describe('PubSub', function() { it('should create a Subscription', function(done) { var opts = { a: 'b', c: 'd' }; + pubsub.request = util.noop; + pubsub.subscription = function(subName, options) { assert.strictEqual(subName, SUB_NAME); assert.deepEqual(options, opts);