test: Dump log for any stuck test

This commit is contained in:
Ankush Menat 2025-12-05 13:13:34 +05:30
parent 36f713b14c
commit a6db2d0429

View file

@ -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