Skip to content

Commit bc3d88c

Browse files
Merge pull request #6181 from MetRonnie/handlers
`cylc stop --now`: fix flaky test & clarify docs
2 parents 7042afa + 74a77ac commit bc3d88c

File tree

3 files changed

+5
-10
lines changed

3 files changed

+5
-10
lines changed

cylc/flow/scripts/stop.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@
5353
CCYYMMDDThh:mm, CCYY-MM-DDThh, etc).
5454
5555
Tasks that become ready after the shutdown is ordered will be submitted
56-
immediately if the workflow is restarted. Remaining task event handlers and
57-
job poll and kill commands, however, will be executed prior to shutdown, unless
58-
--now is used.
56+
immediately if the workflow is restarted. Remaining task event handlers and
57+
job poll and kill commands will be executed prior to shutdown, unless
58+
--now is used twice.
5959
6060
This command exits immediately unless --max-polls is greater than zero, in
6161
which case it polls to wait for workflow shutdown.

tests/functional/shutdown/08-now1.t

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
# Test "cylc stop --now" will wait for event handler.
1919
. "$(dirname "$0")/test_header"
2020

21-
set_test_number 6
21+
set_test_number 5
2222

2323
install_workflow "${TEST_NAME_BASE}" "${TEST_NAME_BASE}"
2424
run_ok "${TEST_NAME_BASE}-validate" cylc validate "${WORKFLOW_NAME}"
@@ -27,10 +27,6 @@ LOGD="$RUN_DIR/${WORKFLOW_NAME}/log"
2727
grep_ok 'INFO - Workflow shutting down - REQUEST(NOW)' "${LOGD}/scheduler/log"
2828
JLOGD="${LOGD}/job/1/t1/01"
2929
# Check that 1/t1 event handler runs
30-
run_ok "${TEST_NAME_BASE}-activity-log-succeeded" \
31-
grep -q -F \
32-
"[(('event-handler-00', 'succeeded'), 1) out] Well done 1/t1 succeeded" \
33-
"${JLOGD}/job-activity.log"
3430
run_ok "${TEST_NAME_BASE}-activity-log-started" \
3531
grep -q -F \
3632
"[(('event-handler-00', 'started'), 1) out] Hello 1/t1 started" \

tests/functional/shutdown/08-now1/flow.cylc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
abort on stall timeout = True
44
stall timeout = PT0S
55
abort on inactivity timeout = True
6-
inactivity timeout = PT3M
6+
inactivity timeout = PT1M
77

88
[scheduling]
99
[[graph]]
@@ -14,6 +14,5 @@
1414
script = cylc__job__wait_cylc_message_started; cylc stop --now "${CYLC_WORKFLOW_ID}"
1515
[[[events]]]
1616
started handlers = sleep 10 && echo 'Hello %(id)s %(event)s'
17-
succeeded handlers = echo 'Well done %(id)s %(event)s'
1817
[[t2]]
1918
script = true

0 commit comments

Comments
 (0)