diff --git a/frappe/tests/classes/integration_test_case.py b/frappe/tests/classes/integration_test_case.py index ac3809b137..0a39226c05 100644 --- a/frappe/tests/classes/integration_test_case.py +++ b/frappe/tests/classes/integration_test_case.py @@ -1,5 +1,7 @@ import copy +import faulthandler import logging +import sys from contextlib import AbstractContextManager, contextmanager from types import MappingProxyType @@ -12,6 +14,8 @@ from .unit_test_case import UnitTestCase logger = logging.Logger(__file__) +STUCK_TEST_THRESHOLD = 5 * 60 + class IntegrationTestCase(UnitTestCase): """Integration test class for Frappe tests. @@ -74,6 +78,8 @@ class IntegrationTestCase(UnitTestCase): super().tearDownClass() def setUp(self) -> None: + faulthandler.dump_traceback_later(STUCK_TEST_THRESHOLD, file=sys.__stderr__) + self.addCleanup(faulthandler.cancel_dump_traceback_later) super().setUp() # Add any per-test setup code here