diff --git a/CIME/SystemTests/system_tests_common.py b/CIME/SystemTests/system_tests_common.py index 3c1f3e99830..7295ea67ca1 100644 --- a/CIME/SystemTests/system_tests_common.py +++ b/CIME/SystemTests/system_tests_common.py @@ -38,7 +38,7 @@ ) import CIME.build as build -import glob, gzip, time, traceback, os +import glob, gzip, time, traceback, os, math from contextlib import ExitStack logger = logging.getLogger(__name__) @@ -173,8 +173,8 @@ def _set_restart_interval(self): else: expect(False, f"stop_option {stop_option} not available for this test") - stop_n = int(stop_n * factor // coupling_secs) - rest_n = int((stop_n // 2 + 1) * coupling_secs / factor) + stop_n = stop_n * factor // coupling_secs + rest_n = math.ceil((stop_n // 2 + 1) * coupling_secs / factor) expect(stop_n > 0, "Bad STOP_N: {:d}".format(stop_n))