[ARVADOS] created: 1.3.0-1717-gcbdda43d0
Git user
git at public.curoverse.com
Wed Oct 9 18:57:06 UTC 2019
at cbdda43d034b07bfeba9f711e4821c5c28c08e7f (commit)
commit cbdda43d034b07bfeba9f711e4821c5c28c08e7f
Author: Peter Amstutz <pamstutz at veritasgenetics.com>
Date: Wed Oct 9 14:56:45 2019 -0400
15694: Add test
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <pamstutz at veritasgenetics.com>
diff --git a/sdk/cwl/tests/test_container.py b/sdk/cwl/tests/test_container.py
index 3374e1c13..b1034222e 100644
--- a/sdk/cwl/tests/test_container.py
+++ b/sdk/cwl/tests/test_container.py
@@ -534,6 +534,21 @@ class TestContainer(unittest.TestCase):
except RuntimeError:
self.fail("RuntimeStatusLoggingHandler should not be called recursively")
+
+ # Test to make sure that an exception raised from get_current_container doesn't
+ @mock.patch("arvados_cwl.util.get_current_container")
+ def test_runtime_status_get_current_container_exception(self, gcc_mock):
+ self.setup_and_test_container_executor_and_logging(gcc_mock)
+ root_logger = logging.getLogger('')
+
+ # get_current_container is invoked when we call runtime_status_update
+ # so try and log again!
+ gcc_mock.side_effect = Exception("Second Error")
+ try:
+ root_logger.error("First Error")
+ except RuntimeError:
+ self.fail("RuntimeStatusLoggingHandler should not be called recursively")
+
@mock.patch("arvados_cwl.ArvCwlExecutor.runtime_status_update")
@mock.patch("arvados_cwl.util.get_current_container")
@mock.patch("arvados.collection.CollectionReader")
commit 02a9d43ab7340d2cf6ce6c13d42e579729595071
Author: Peter Amstutz <pamstutz at veritasgenetics.com>
Date: Wed Oct 9 14:10:11 2019 -0400
15694: Catch exception from get_current_container in runtime_status_update
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <pamstutz at veritasgenetics.com>
diff --git a/sdk/cwl/arvados_cwl/executor.py b/sdk/cwl/arvados_cwl/executor.py
index eed2fe19d..406ebfd2d 100644
--- a/sdk/cwl/arvados_cwl/executor.py
+++ b/sdk/cwl/arvados_cwl/executor.py
@@ -250,7 +250,11 @@ The 'jobs' API is no longer supported.
activity statuses, for example in the RuntimeStatusLoggingHandler.
"""
with self.workflow_eval_lock:
- current = arvados_cwl.util.get_current_container(self.api, self.num_retries, logger)
+ current = None
+ try:
+ current = arvados_cwl.util.get_current_container(self.api, self.num_retries, logger)
+ except Exception as e:
+ logger.info("Couldn't get current container: %s", e)
if current is None:
return
runtime_status = current.get('runtime_status', {})
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list