Merge pull request #35083 from ankush/monitor_test

test: automatically print stuck tests
This commit is contained in:
Akhil Narang 2025-12-05 14:18:22 +05:30 committed by GitHub
commit da92e7cd36
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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