Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_UnorderedUnack and test_OrderedUnack tests fail #150

Closed
jsandovalc opened this issue Apr 11, 2016 · 8 comments
Closed

test_UnorderedUnack and test_OrderedUnack tests fail #150

jsandovalc opened this issue Apr 11, 2016 · 8 comments

Comments

@jsandovalc
Copy link

Hi. I just cloned the txmongo repository and I'm trying to run the tests. In test_queries.py, in TestInsertMany, I'm getting two FAILs for test_UnorderedUnack and test_OrderedUnack.

I'm using python3.5 with mongo3.2.3. Any clues?. Thanks.

@psi29a
Copy link
Contributor

psi29a commented Apr 12, 2016

and have you tried with python3.4? Or in combination with an earlier version of mongo 3.2.x?

@IlyaSkriblovsky
Copy link
Contributor

Please post here stacktraces of these FAILs, they may help to reason

@jsandovalc
Copy link
Author

I don't get any stacktrace when I execute the test, only the FAIL.

[FAIL]
Traceback (most recent call last):
  File "/home/ark/repositorios/rest-service/venv/lib/python3.5/site-packages/twisted/internet/defer.py", line 1128, in _inlineCallbacks
    result = g.send(result)
  File "/home/ark/repositorios/txmongo/tests/test_queries.py", line 656, in test_UnorderedUnack
    self.assertEqual(count, 2)
  File "/home/ark/repositorios/rest-service/venv/lib/python3.5/site-packages/twisted/trial/_synctest.py", line 437, in assertEqual
    super(_Assertions, self).assertEqual(first, second, msg)
  File "/usr/local/lib/python3.5/unittest/case.py", line 820, in assertEqual
    assertion_func(first, second, msg=msg)
  File "/usr/local/lib/python3.5/unittest/case.py", line 813, in _baseAssertEqual
    raise self.failureException(msg)
twisted.trial.unittest.FailTest: 0 != 2

tests.test_queries.TestInsertMany.test_UnorderedUnack
-------------------------------------------------------------------------------
Ran 1 tests in 0.011s

FAILED (failures=1)

Compilation exited abnormally with code 1 at Tue Apr 12 09:17:05

The input is:

docs = [{'x': 1}, {'x': 2, '$': "error"}, {'x': 3}]

@jsandovalc
Copy link
Author

I tested with a mongo2.4 I have installed, and the two tests are OK.

@IlyaSkriblovsky
Copy link
Contributor

Yeah, I confirm failues with MongoDB 3.0 and 3.2 with any version of Python. That strange, because all tests were passing on Travis with MongoDB 3.0.11...

@IlyaSkriblovsky
Copy link
Contributor

Whoops, I was wrong. I re-checked again and seems that failues are only with MongoDB 3.2.x.

@IlyaSkriblovsky
Copy link
Contributor

Ok, seems like 3.2 does document validating differently than 3.0. I've tested how insert_many deals with failues by inserting [{'x':1}, {'x':2, '$': "error"}, {'x':3}]. Mongo 3.0 did validation before inserting each document, so it inserted first and third. But 3.2 seems to do validation of all docs before doing anything, so it inserts none. I've changed these tests to use [{"_id": 1}, {"_id": 1, }, {"_id": 2}] and now they passing on both 3.0 and 3.2.

Created #151

@psi29a
Copy link
Contributor

psi29a commented Apr 12, 2016

Great find and detective work!

@psi29a psi29a added this to the 16.0 - Getting things fixed milestone Apr 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants