diff --git a/packages/mongo-livedata/mongo_driver.js b/packages/mongo-livedata/mongo_driver.js index 9d8063fa56..baaa2eeab5 100644 --- a/packages/mongo-livedata/mongo_driver.js +++ b/packages/mongo-livedata/mongo_driver.js @@ -999,9 +999,8 @@ MongoConnection.prototype._observeChanges = function ( _testOnlyPollCallback: callbacks._testOnlyPollCallback }); - // This field is only set for the first ObserveHandle in an - // ObserveMultiplexer. It is only there for use tests. - observeHandle._observeDriver = observeDriver; + // This field is only set for use in tests. + multiplexer._observeDriver = observeDriver; } // Blocks until the initial adds have been sent. diff --git a/packages/mongo-livedata/mongo_livedata_tests.js b/packages/mongo-livedata/mongo_livedata_tests.js index 1f163b4e4b..dbb4a65d36 100644 --- a/packages/mongo-livedata/mongo_livedata_tests.js +++ b/packages/mongo-livedata/mongo_livedata_tests.js @@ -391,13 +391,9 @@ Tinytest.addAsync("mongo-livedata - fuzz test, " + idGeneration, function(test, } }); - // XXX What if there are multiple observe handles on the ObserveMultiplexer? - // There shouldn't be because the collection has a name unique to this - // run. if (Meteor.isServer) { - // For now, has to be polling (not oplog). - test.isTrue(obs._observeDriver); - test.isTrue(obs._observeDriver._suspendPolling); + // For now, has to be polling (not oplog) because it is ordered observe. + test.isTrue(obs._multiplexer._observeDriver._suspendPolling); } var step = 0; @@ -432,7 +428,7 @@ Tinytest.addAsync("mongo-livedata - fuzz test, " + idGeneration, function(test, finishObserve(function () { if (Meteor.isServer) - obs._observeDriver._suspendPolling(); + obs._multiplexer._observeDriver._suspendPolling(); // Do a batch of 1-10 operations var batch_count = rnd(10) + 1; @@ -465,7 +461,7 @@ Tinytest.addAsync("mongo-livedata - fuzz test, " + idGeneration, function(test, } } if (Meteor.isServer) - obs._observeDriver._resumePolling(); + obs._multiplexer._observeDriver._resumePolling(); }); @@ -1886,14 +1882,12 @@ Meteor.isServer && Tinytest.add("mongo-livedata - oplog - _disableOplog", functi if (MongoInternals.defaultRemoteCollectionDriver().mongo._oplogHandle) { var observeWithOplog = coll.find({x: 5}) .observeChanges({added: function () {}}); - test.isTrue(observeWithOplog._observeDriver); - test.isTrue(observeWithOplog._observeDriver._usesOplog); + test.isTrue(observeWithOplog._multiplexer._observeDriver._usesOplog); observeWithOplog.stop(); } var observeWithoutOplog = coll.find({x: 6}, {_disableOplog: true}) .observeChanges({added: function () {}}); - test.isTrue(observeWithoutOplog._observeDriver); - test.isFalse(observeWithoutOplog._observeDriver._usesOplog); + test.isFalse(observeWithoutOplog._multiplexer._observeDriver._usesOplog); observeWithoutOplog.stop(); });