From 8772e618877b94002ddd0802247316d60265fcf4 Mon Sep 17 00:00:00 2001 From: TerrenceMcGuinness-NOAA Date: Tue, 20 Aug 2024 12:11:39 -0400 Subject: [PATCH] Fixed test on UNAVAILBLE in python Rocoto check (#2842) Update the test for UNAVAILABLE from inclusion to count: `if ['UNAVAILABLE'] > 0` in `rocotocheck.py `script. --- ci/scripts/utils/rocotostat.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ci/scripts/utils/rocotostat.py b/ci/scripts/utils/rocotostat.py index 4afea5c8b5..230a1a6025 100755 --- a/ci/scripts/utils/rocotostat.py +++ b/ci/scripts/utils/rocotostat.py @@ -136,7 +136,7 @@ def rocoto_statcount(rocotostat): rocotostat_output = [line.split()[0:4] for line in rocotostat_output] rocotostat_output = [line for line in rocotostat_output if len(line) != 1] - status_cases = ['SUCCEEDED', 'FAIL', 'DEAD', 'RUNNING', 'SUBMITTING', 'QUEUED', 'UNAVAILABLE'] + status_cases = ['SUCCEEDED', 'FAIL', 'DEAD', 'RUNNING', 'SUBMITTING', 'QUEUED', 'UNAVAILABLE', 'UNKNOWN'] rocoto_status = {} status_counts = Counter(case for sublist in rocotostat_output for case in sublist) @@ -214,14 +214,14 @@ def is_stalled(rocoto_status): elif rocoto_status['DEAD'] > 0: error_return = rocoto_status['FAIL'] + rocoto_status['DEAD'] rocoto_state = 'FAIL' - elif 'UNAVAILABLE' in rocoto_status or 'UNKNOWN' in rocoto_status: + elif rocoto_status['UNAVAILABLE'] > 0 or rocoto_status['UNKNOWN'] > 0: rocoto_status = attempt_multiple_times(lambda: rocoto_statcount(rocotostat), 2, 120, ProcessError) error_return = 0 rocoto_state = 'RUNNING' - if 'UNAVAILABLE' in rocoto_status: + if rocoto_status['UNAVAILABLE'] > 0: error_return = rocoto_status['UNAVAILABLE'] rocoto_state = 'UNAVAILABLE' - if 'UNKNOWN' in rocoto_status: + if rocoto_status['UNKNOWN'] > 0: error_return += rocoto_status['UNKNOWN'] rocoto_state = 'UNKNOWN' elif is_stalled(rocoto_status):