Skip to content

Commit

Permalink
Remove unncessary reftest cycle point load logic
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewrmshin committed Aug 14, 2019
1 parent f0c19d4 commit d9e802a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 41 deletions.
6 changes: 2 additions & 4 deletions cylc/flow/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,8 +417,6 @@ def configure(self):
self.task_events_mgr.mail_footer = self._get_events_conf("mail footer")
self.task_events_mgr.suite_url = self.config.cfg['meta']['URL']
self.task_events_mgr.suite_cfg = self.config.cfg['meta']
if self.options.reftest:
self.suite_event_handler.configure_reftest_points(self.config)
if self.options.genref:
LOG.addHandler(ReferenceLogFileHandler(
self.config.get_ref_log_name()))
Expand Down Expand Up @@ -460,6 +458,8 @@ def configure(self):
self.load_tasks_for_restart()
else:
self.load_tasks_for_run()
if self.options.stopcp:
self.pool.set_stop_point(get_point(self.options.stopcp))
self.profiler.log_memory("scheduler.py: after load_tasks")

self.suite_db_mgr.put_suite_params(self)
Expand Down Expand Up @@ -538,8 +538,6 @@ def load_tasks_for_restart(self):
# Remote init is done via process pool
self.proc_pool.process()
self.command_poll_tasks()
if self.options.stopcp:
self.pool.set_stop_point(get_point(self.options.stopcp))

def _load_task_run_times(self, row_idx, row):
"""Load run times of previously succeeded task jobs."""
Expand Down
21 changes: 0 additions & 21 deletions cylc/flow/suite_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,27 +196,6 @@ def _run_event_mail_callback(proc_ctx):
else:
LOG.info(str(proc_ctx))

@staticmethod
def configure_reftest_points(config):
"""Reference test helper.
Load initial, start, final cycle points from the reference log.
"""
re_points = re.compile(r'(Initial|Start|Final)\s+point:\s*(.*)$')
done = set()
for line in open(config.get_ref_log_name(), 'r'):
match = re_points.search(line)
if match:
key, value = match.groups()
if value == "None":
value = None
attr = '%s_point' % key.lower()
if hasattr(config, attr):
setattr(config, attr, get_point(value))
done.add(attr)
if 'start_point' not in done:
config.start_point = config.initial_point

def _run_reftest(self, config, ctx):
"""Run reference test at shutdown."""
reffilename = config.get_ref_log_name()
Expand Down
28 changes: 14 additions & 14 deletions tests/restart/10-pre-initial-2.t
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@
#-------------------------------------------------------------------------------
# Test restarting a suite with pre-initial cycle dependencies and no
# initial cycle point in suite definition, ref. github #957.
. $(dirname $0)/test_header
#-------------------------------------------------------------------------------
. "$(dirname "$0")/test_header"
set_test_number 3
install_suite "${TEST_NAME_BASE}" 'pre-init-2'
#-------------------------------------------------------------------------------
install_suite $TEST_NAME_BASE pre-init-2
export TEST_DIR
#-------------------------------------------------------------------------------
TEST_NAME=$TEST_NAME_BASE-validate
run_ok $TEST_NAME cylc validate --icp=20100808T00 $SUITE_NAME
#-------------------------------------------------------------------------------
TEST_NAME=$TEST_NAME_BASE-run
suite_run_ok $TEST_NAME cylc run --debug --no-detach --until=20100808T00 $SUITE_NAME 20100808T00
#-------------------------------------------------------------------------------
TEST_NAME=$TEST_NAME_BASE-restart
suite_run_ok $TEST_NAME cylc restart --debug --no-detach --reference-test $SUITE_NAME
ICP='20100808T00'
run_ok "${TEST_NAME_BASE}-validate" \
cylc validate --initial-cycle-point="${ICP}" "${SUITE_NAME}"
suite_run_ok "${TEST_NAME_BASE}-run" \
cylc run --debug --no-detach \
--initial-cycle-point="${ICP}" \
--stop-cycle-point="${ICP}" \
"${SUITE_NAME}"
suite_run_ok "${TEST_NAME_BASE}-restart" \
cylc restart --debug --no-detach --reference-test "${SUITE_NAME}"
#-------------------------------------------------------------------------------
purge_suite $SUITE_NAME
purge_suite "${SUITE_NAME}"
exit
2 changes: 0 additions & 2 deletions tests/restart/pre-init-2/suite.rc
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@

[cylc]
cycle point format = %Y%m%dT%H
[[events]]
startup handler = cylc release '%(suite)s'

[scheduling]
# DO NOT PUT AN INITIAL CYCLE TIME HERE,
Expand Down

0 comments on commit d9e802a

Please sign in to comment.