Skip to content

Commit

Permalink
[FIX] base: fix test retry
Browse files Browse the repository at this point in the history
Since auto retry was disabled after the first failure, the test_retry
test suite will systematicaly fail if another test fails before, adding
confusing logs.

Fix the way the retry count is detected to solve the issue.

closes odoo#188144

X-original-commit: 0972630
Signed-off-by: William Braeckman (wbr) <[email protected]>
Signed-off-by: Xavier Dollé (xdo) <[email protected]>
  • Loading branch information
Xavier-Do committed Nov 22, 2024
1 parent fabfa20 commit f4f0064
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions odoo/addons/base/tests/test_test_retry.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.tests import BaseCase, TransactionCase, tagged
from odoo.tests import BaseCase, TransactionCase, tagged, BaseCase
from odoo.tests.common import _logger as test_logger

import logging
Expand All @@ -27,7 +27,7 @@ def runbot(message, *args):
cls.startClassPatcher(patcher)

def get_tests_run_count(self):
return int(os.environ.get('ODOO_TEST_FAILURE_RETRIES', 0)) + 1
return BaseCase._tests_run_count

def update_count(self):
self.count = getattr(self, 'count', 0) + 1
Expand Down

0 comments on commit f4f0064

Please sign in to comment.