twisted / txmongo

asynchronous python driver for mongo
https://txmongo.readthedocs.io
Apache License 2.0
338 stars 102 forks source link

Tests fixed for MongoDB 3.4 #212

Closed IlyaSkriblovsky closed 7 years ago

IlyaSkriblovsky commented 7 years ago

I've noticed that several tests were failing against modern MongoDB 3.4

  1. https://github.com/twisted/txmongo/compare/master...IlyaSkriblovsky:mongodb-3.4-tests-fixed?expand=1#diff-cecc483f704c4be15eaed66c3bb3678bL302 MongoDB 3.4 changed behavior of the first batch of find() command. Before it was returning maximum of 1mb in the first batch, now this restriction is loosened, so this test fails. Actually I think this test is redundant, it was checking that negative limit forces only the single batch in result. It is not our concern anyways.

  2. https://github.com/twisted/txmongo/compare/master...IlyaSkriblovsky:mongodb-3.4-tests-fixed?expand=1#diff-cecc483f704c4be15eaed66c3bb3678bL384 MongoDB 3.4 changed error message in that case

  3. https://github.com/twisted/txmongo/compare/master...IlyaSkriblovsky:mongodb-3.4-tests-fixed?expand=1#diff-1f3700c74d32647bfd888de73a25b21dL1025 This one is actually a bug. Ghost _deadline kwarg were added in index specification by create_index. MongoDB ≤3.2 just ignores it, so it wasn't noticed. 3.4 throws an error here.

IlyaSkriblovsky commented 7 years ago

Test will probably fail due to #210. I will rebase this PR onto #211 once it merged.

psi29a commented 7 years ago

Good catch on # 3, 3.4 does validation checking on indexes now and we caught this in another area of our code at work where MongoEngine was using safe=True and type=False. So it make sense that it would choke on _deadline.

psi29a commented 7 years ago

Hmmm:

This job ran on our Precise environment, which is in the process of being decommissioned. Please read about the rollout of Trusty as default on the blog, and take note that you can explicitly stay on Precise by specifying dist: precise in your .tr

Guess I'll look into this as well.

IlyaSkriblovsky commented 7 years ago

Seems like Travis is still testing against MongoDB 3.0. Can we fix this too as well? :)

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.003%) to 95.194% when pulling 061247182f3a0a679647b9f01c08cef1c9863711 on IlyaSkriblovsky:mongodb-3.4-tests-fixed into 4856f7790299bd3ad7f8facd9639e23270adcb61 on twisted:master.

psi29a commented 7 years ago

I'll get on that this weekend.