Commit 4bbaba5d authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

Fix for exception in record_stats_memusage() in case processing is not started...

Fix for exception in record_stats_memusage() in case processing is not started with L1A but continued from a higher processing level.
Added Test_ProcessContinuing_CompletePipeline.test_continue_from_L2C().
parent 808f4a5b
...@@ -1421,6 +1421,11 @@ def archive_exists_on_fileserver(conn_DB, entityID): ...@@ -1421,6 +1421,11 @@ def archive_exists_on_fileserver(conn_DB, entityID):
def record_stats_memusage(conn_db, GMS_obj): def record_stats_memusage(conn_db, GMS_obj):
# type: (str, GMS_object) -> bool # type: (str, GMS_object) -> bool
if list(sorted(GMS_obj.mem_usage.keys())) != ['L1A', 'L1B', 'L1C', 'L2A', 'L2B', 'L2C']:
GMS_obj.logger.info('Unable to record memory usage statistics because statistics are missing for some '
'processing levels. ')
return False
vals2write_dict = dict( vals2write_dict = dict(
creationtime=datetime.now(), creationtime=datetime.now(),
software_version=CFG.version, software_version=CFG.version,
......
...@@ -427,13 +427,14 @@ class Test_ProcessContinuing_CompletePipeline(unittest.TestCase): ...@@ -427,13 +427,14 @@ class Test_ProcessContinuing_CompletePipeline(unittest.TestCase):
exec_L2CP=[False, False, False] exec_L2CP=[False, False, False]
)) ))
def test_continue_from_L1A(self):
cfg_kw = self.cfg_kw
# produce L1A data and stop processing there # produce L1A data and stop processing there
self.create_job(26186263, self.cfg_kw) # 1x L5 pre-collection self.create_job(26186263, cfg_kw) # 1x L5 pre-collection
self.PC.run_all_processors() self.PC.run_all_processors()
def test_continue_from_L1A(self):
# create a new job and try to continue from L1A # create a new job and try to continue from L1A
cfg_kw = self.cfg_kw
cfg_kw.update(dict( cfg_kw.update(dict(
exec_L1BP=[True, True, False], exec_L1BP=[True, True, False],
delete_old_output=False delete_old_output=False
...@@ -441,6 +442,28 @@ class Test_ProcessContinuing_CompletePipeline(unittest.TestCase): ...@@ -441,6 +442,28 @@ class Test_ProcessContinuing_CompletePipeline(unittest.TestCase):
self.create_job(26186263, cfg_kw) # 1x L5 pre-collection self.create_job(26186263, cfg_kw) # 1x L5 pre-collection
self.PC.run_all_processors() self.PC.run_all_processors()
def test_continue_from_L2C(self):
cfg_kw = self.cfg_kw
cfg_kw.update(dict(
exec_L1AP=[True, True, True],
exec_L1BP=[True, True, True],
exec_L1CP=[True, True, True],
exec_L2AP=[True, True, True],
exec_L2BP=[True, True, False],
exec_L2CP=[True, True, False],
))
# produce L1A data and stop processing there
self.create_job(26186263, cfg_kw) # 1x L5 pre-collection
self.PC.run_all_processors()
# create a new job and try to continue from L2C
cfg_kw.update(dict(
delete_old_output=False
))
self.create_job(26186263, cfg_kw) # 1x L5 pre-collection
self.PC.run_all_processors()
################################################################################### ###################################################################################
# Summarizing the information regarding the test datasets. # Summarizing the information regarding the test datasets.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment