mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-20 04:13:07 +02:00
Tests - Don't hang if spawning taskw fails
This commit is contained in:
parent
3b192cddcf
commit
3f004f547e
1 changed files with 18 additions and 1 deletions
|
@ -108,7 +108,20 @@ def _queue_output(arguments, pidq, outputq):
|
|||
kwargs = arguments["process"]
|
||||
input = arguments["input"]
|
||||
|
||||
proc = Popen(**kwargs)
|
||||
try:
|
||||
proc = Popen(**kwargs)
|
||||
except OSError as e:
|
||||
# pid None is read by the main thread as a crash of the process
|
||||
pidq.put(None)
|
||||
|
||||
outputq.put((
|
||||
"",
|
||||
("Unexpected exception caught during execution of taskw: '{0}' . "
|
||||
"If you are running out-of-tree tests set USE_PATH=1 in shell "
|
||||
"env before execution".format(e)),
|
||||
255)) # false exitcode
|
||||
|
||||
return
|
||||
|
||||
# NOTE If for whatever reason pid is None at the time of access, use the
|
||||
# following line instead
|
||||
|
@ -161,6 +174,10 @@ def _get_output(arguments, timeout=None):
|
|||
try:
|
||||
pid = pidq.get(timeout=timeout)
|
||||
except Empty:
|
||||
pid = None
|
||||
|
||||
# Process crashed or timed out for some reason
|
||||
if pid is None:
|
||||
return _retrieve_output(t, output_timeout, outputq,
|
||||
"TaskWarrior to start")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue