File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -253,11 +253,16 @@ def _test_threading():
253253 from matplotlib .ft2font import LOAD_NO_HINTING
254254 import matplotlib .font_manager as fm
255255
256+ def loud_excepthook (args ):
257+ raise RuntimeError ("error in thread!" )
258+
259+ threading .excepthook = loud_excepthook
260+
256261 N = 10
257262 b = threading .Barrier (N )
258263
259264 def bad_idea (n ):
260- b .wait ()
265+ b .wait (timeout = 5 )
261266 for j in range (100 ):
262267 font = fm .get_font (fm .findfont ("DejaVu Sans" ))
263268 font .set_text (str (n ), 0.0 , flags = LOAD_NO_HINTING )
@@ -271,7 +276,9 @@ def bad_idea(n):
271276 t .start ()
272277
273278 for t in threads :
274- t .join ()
279+ t .join (timeout = 9 )
280+ if t .is_alive ():
281+ raise RuntimeError ("thread failed to join" )
275282
276283
277284def test_fontcache_thread_safe ():
You can’t perform that action at this time.
0 commit comments