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:
parent
2f87a09ad9
commit
ef6af0b0ad
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue
Block a user