2
0
mirror of https://github.com/frappe/frappe.git synced 2024-06-03 01:50:48 +00:00

test: setup signal and faulthandler to debug stuck tests (#25494)

This commit is contained in:
Ankush Menat 2024-03-17 16:31:34 +05:30 committed by GitHub
parent 2f87a09ad9
commit ef6af0b0ad
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,6 +1,8 @@
import faulthandler
import json
import os
import re
import signal
import sys
import time
import unittest
@ -108,6 +110,11 @@ class ParallelTestRunner:
return frappe.get_module(module_name)
def print_result(self):
# XXX: Added to debug tests getting stuck AFTER completion
# the process should terminate before this, we don't need to reset the signal.
signal.alarm(60)
faulthandler.register(signal.SIGALRM)
self.test_result.printErrors()
click.echo(self.test_result)
if self.test_result.failures or self.test_result.errors: