MongoEngine / mongoengine

A Python Object-Document-Mapper for working with MongoDB
http://mongoengine.org
MIT License
4.26k stars 1.23k forks source link

Address flaky transaction tests #2846

Closed juannyG closed 2 months ago

juannyG commented 2 months ago

Resolves https://github.com/MongoEngine/mongoengine/issues/2841


The majority of failures appeared to be attributed with the test_exception_in_child_of_a_nested_transaction_rolls_parent_back unit test.

To resolve this test, I borrowed the approach taken by the test just below it: test_exception_in_parent_of_nested_transaction_after_child_completed_only_rolls_parent_back which was already creating a function for the work under test and simply trapping the TransientTractionError.

After resolving this, I found that the max transaction lock request timeout parameter needed to be modified. After doing so and letting the test suite run indefinitely unless error, test failures appeared to have ceased.

bagerard commented 2 months ago

Looks good, thanks :+1: