Skip to content

Make sure that backend testing in multiprocessing is done with a timeout #3741

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

Merged
merged 4 commits into from
Nov 1, 2014
Merged
Changes from 1 commit
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
Prev Previous commit
Catch the right error
  • Loading branch information
jenshnielsen committed Oct 30, 2014
commit cbddb9938520387144b730e8d8d26a125e9c17f4
19 changes: 9 additions & 10 deletions setupext.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import warnings
from textwrap import fill


PY3 = (sys.version_info[0] >= 3)


Expand Down Expand Up @@ -1789,12 +1788,12 @@ def check_requirements(self):
return "unknown (can not use multiprocessing to determine)"
try:
res = p.map_async(backend_gtk3agg_internal_check, [0])
success, msg = res.get(timeout=5)[0]
except Queue.Empty:
success, msg = res.get(timeout=10)[0]
except multiprocessing.TimeoutError:
p.terminate()
# No result returned. Probaly hanging, terminate the process.
success = False
raise
raise CheckFailed("Check timed out")
except:
p.close()
# Some other error.
Expand Down Expand Up @@ -1864,12 +1863,12 @@ def check_requirements(self):
return "unknown (can not use multiprocessing to determine)"
try:
res = p.map_async(backend_gtk3cairo_internal_check, [0])
success, msg = res.get(timeout=5)[0]
except Queue.Empty:
success, msg = res.get(timeout=10)[0]
except multiprocessing.TimeoutError:
p.terminate()
# No result returned. Probaly hanging, terminate the process.
success = False
raise
raise CheckFailed("Check timed out")
except:
p.close()
success = False
Expand Down Expand Up @@ -2012,11 +2011,11 @@ def check_requirements(self):
# Multiprocessing OK
try:
res = p.map_async(self.callback, [self])
msg = res.get(timeout=5)[0]
except Queue.Empty:
msg = res.get(timeout=10)[0]
except multiprocessing.TimeoutError:
p.terminate()
# No result returned. Probaly hanging, terminate the process.
raise
raise CheckFailed("Check timed out")
except:
# Some other error.
p.close()
Expand Down