Please sign in to comment.
[FIX] tests: make --test-file great again
Sort of but not really, this commit fixes a special case in which launching a --test-file of a file with at least two SavepointCases would create a postgresql deadlock and it would be impossible to terminate the Odoo process without sending a SIGKILL or waiting for the lock to timeout. This was introduced at #39368 and happens because of the way that unittests unwraps suites, to keep it short, when it unwraps the custom OdooSuite class internally, it ends up with a vanilla TestSuite with which to run the different test cases, and since #39368 depends on the overrides added to OdooSuite to function, the class cleanups are not triggered at the end of a test class (rollback, cache cleanups, env reset, registry reset, etc.). The fix is to manually unwrap the suite of tests to keep OdooSuite as the suite with which to call the tests, which was already done for --test-enable (although for different reasons, --test-tags?) which is why --test-enable didn't have any problems. This commit also fixes a typo I found on the backport, which meant classCleanups were not being executed if the setUpClass failed, but it had no effect on classCleanups during tearDownClass. Task-ID 2160398 Depends on #43135
- Loading branch information
Showing with 4 additions and 4 deletions.