Skip to content

Make sure that backend testing is done with a timeout. #3740

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions setupext.py
Original file line number Diff line number Diff line change
Expand Up @@ -1717,7 +1717,8 @@ def check_requirements(self):
except:
return "unknown (can not use multiprocessing to determine)"
try:
success, msg = p.map(backend_gtk3agg_internal_check, [0])[0]
res = p.map_async(backend_gtk3agg_internal_check, [0])
success, msg = res.get(timeout=5)[0]
except:
success = False
msg = "Could not determine"
Expand Down Expand Up @@ -1781,9 +1782,15 @@ def check_requirements(self):
p = multiprocessing.Pool()
except:
return "unknown (can not use multiprocessing to determine)"
success, msg = p.map(backend_gtk3cairo_internal_check, [0])[0]
p.close()
p.join()
try:
res = p.map_async(backend_gtk3cairo_internal_check, [0])
success, msg = res.get(timeout=5)[0]
except:
success = False
raise
finally:
p.close()
p.join()
if success:
BackendAgg.force = True

Expand Down Expand Up @@ -1916,7 +1923,8 @@ def check_requirements(self):
else:
# Multiprocessing OK
try:
msg = p.map(self.callback, [self])[0]
res = p.map_async(self.callback, [self])
msg = res.get(timeout=5)[0]
except:
# If we hit an error on multiprocessing raise it
raise
Expand Down