There was an error while loading. Please reload this page.
1 parent 5a6ad51 commit 65a768dCopy full SHA for 65a768d
test/test_pooling_base.py
@@ -804,7 +804,15 @@ def find_slow():
804
805
# Javascript function that pauses N seconds per document
806
fn = delay(10)
807
- self.assertEqual(1, db.test.find({"$where": fn}).count())
+ if is_mongos(db.connection):
808
+ # mongos doesn't support eval so we have to use $where
809
+ # which is less reliable in this context.
810
+ self.assertEqual(1, db.test.find({"$where": fn}).count())
811
+ else:
812
+ # 'nolock' allows find_fast to start and finish while we're
813
+ # waiting for this to complete.
814
+ self.assertEqual({'ok': 1.0, 'retval': True},
815
+ db.command('eval', fn, nolock=True))
816
817
history.append('find_slow done')
818
0 commit comments