[SERVER-18229] Smoke.py with PyMongo 3.0.1 fails to run certain tests Created: 27/Apr/15  Updated: 19/Sep/15  Resolved: 28/Apr/15

Status: Closed
Project: Core Server
Component/s: Testing Infrastructure
Affects Version/s: 3.1.1
Fix Version/s: 2.6.10, 3.0.3, 3.1.2

Type: Bug Priority: Major - P3
Reporter: Ernie Hershey Assignee: Sam Kleinman (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-18073 Fix smoke.py to work with pymongo 3.0 Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Completed:
Sprint: BUILD 3 05/15/15
Participants:

 Description   

Failed test:
https://mci.10gen.com/task/mongodb_mongo_master_windows_64_34b853ed0566a3bbffcd825191b9000de331bddc_15_04_27_15_34_07_jsCore_small_oplog_rs_windows_64/0?type=ALL#L97

Successful test:
https://mci.10gen.com/task/mongodb_mongo_master_windows_64_54c25da33ec7270295c8948f6a51376ec4fd278c_15_04_23_20_04_07_jsCore_small_oplog_rs_windows_64/0?type=ALL

The error:

 [2015/04/27 17:42:17.378] timed out
 [2015/04/27 17:42:17.378] Exception AttributeError: "'Cursor' object has no attribute '_Cursor__id'" in <bound method Cursor.__del__ of <pymongo.cursor.Cursor object at 0x00000000021695C0>> ignored
 [2015/04/27 17:42:17.380] Cannot catch signals on Windows
 [2015/04/27 17:42:17.380] Creating dir: /data/db/sconsTests/
 [2015/04/27 17:42:17.380] running ./mongod.exe --port 27999 --dbpath /data/db/sconsTests/ --setParameter enableTestCommands=1 --httpinterface --replSet foo --oplogSize 511
 [2015/04/27 17:42:17.380] Creating dir: /data/db/sconsTestsSlave/
 [2015/04/27 17:42:17.380] running ./mongod.exe --port 28000 --dbpath /data/db/sconsTestsSlave/ --setParameter enableTestCommands=1 --httpinterface --replSet foo --oplogSize 511
 [2015/04/27 17:42:23.385] 0 tests succeeded
 [2015/04/27 17:42:23.385] 782 tests didn't get run
 [2015/04/27 17:42:23.385] replication ok for 0 collections
 [2015/04/27 17:42:23.956] timed out
 [2015/04/27 17:42:23.956] Traceback (most recent call last):
 [2015/04/27 17:42:23.956]   File "buildscripts/smoke.py", line 1448, in <module>
 [2015/04/27 17:42:23.956]     main()
 [2015/04/27 17:42:23.956]   File "buildscripts/smoke.py", line 1432, in main
 [2015/04/27 17:42:23.956]     run_tests(tests)
 [2015/04/27 17:42:23.956]   File "buildscripts/smoke.py", line 726, in run_tests
 [2015/04/27 17:42:23.956]     slave.start()
 [2015/04/27 17:42:23.956]   File "buildscripts/smoke.py", line 275, in start
 [2015/04/27 17:42:23.956]     for source in local.sources.find(fields=["syncedTo"]):
 [2015/04/27 17:42:23.956]   File "C:\Python27\lib\site-packages\pymongo\collection.py", line 929, in find
 [2015/04/27 17:42:23.956]     return Cursor(self, *args, **kwargs)
 [2015/04/27 17:42:23.956] TypeError: __init__() got an unexpected keyword argument 'fields'
 [2015/04/27 17:42:23.965] [shell.exec] Script finished with error: exit status 1
 [2015/04/27 17:42:23.965] Finished shell.exec in 15.921s
 [2015/04/27 17:42:23.965] Command failed: exit status 1
 [2015/04/27 17:42:23.965] Command failed: exit status 1
 [2015/04/27 17:42:23.965] Task completed - FAILURE.

And I verified by hand the smoke.py command from the failed test with the same binaries and artifacts from MCI on a spawnhost with the default pymongo fails in the same way, after running easy_install --upgrade pymongo, it fails in the same way, and after running easy_install "pymongo<3.0" it runs to completion.

I'm not sure if this is a bug in the tests, in smoke.py, or in pymongo.



 Comments   
Comment by Githook User [ 28/Apr/15 ]

Author:

{u'username': u'tychoish', u'name': u'Sam Kleinman', u'email': u'samk@10gen.com'}

Message: SERVER-18229: fix smoke.py interaction with pymongo
Branch: v2.6
https://github.com/mongodb/mongo/commit/083c1ddf942453cbeeb0dbde6542c87a86c27894

Comment by Githook User [ 28/Apr/15 ]

Author:

{u'username': u'tychoish', u'name': u'Sam Kleinman', u'email': u'samk@10gen.com'}

Message: SERVER-18229: fix smoke.py interaction with pymongo
Branch: v3.0
https://github.com/mongodb/mongo/commit/73d9eb5a4407a4b7724cadb2b5dd778a97a4d207

Comment by Githook User [ 28/Apr/15 ]

Author:

{u'username': u'tychoish', u'name': u'Sam Kleinman', u'email': u'samk@10gen.com'}

Message: SERVER-18229: fix smoke.py interaction with pymongo
Branch: master
https://github.com/mongodb/mongo/commit/ca9606547991adffb30fea7c32bcdc82fc80b22e

Comment by Bernie Hackett [ 28/Apr/15 ]

Actually, this can be fixed easily and work in either pymongo branch. Change this:

for source in local.sources.find(fields=["syncedTo"]):

to this:

for source in local.sources.find({}, ["syncedTo"]):

Comment by Bernie Hackett [ 28/Apr/15 ]

This is an incompatibility between smoke.py and PyMongo 3.x. The problem is here:

https://github.com/mongodb/mongo/blob/master/buildscripts/smoke.py#L275

PyMongo 3.0 implements the CRUD spec, which changed the 'fields' parameter to 'projection'. There are three options to move forward:

  • Remove the projection from the query (this seems easiest)
  • Require pymongo < 3.0 until pymongo 2.9 is released
  • Require pymongo >= 3.0 and update smoke.py

PyMongo 2.9 is a migration path release that backports a number of things from 3.0 to allow writing libraries that can work with 2.x or 3.x. For this ticket PYTHON-886 is most relevant. 2.9 is the next planned release of PyMongo.

Generated at Thu Feb 08 03:47:01 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.