Skip to content

Commit

Permalink
tests/f: make shutdown/08 more explicit (#6185)
Browse files Browse the repository at this point in the history
* Test relied on an action occurring within an arbitrary sleep period
  which is potentially flaky.
* Replaced the sleep with a poller to make it more reliable.
  • Loading branch information
oliver-sanders committed Jul 11, 2024
1 parent dd170d4 commit c734e7d
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions tests/functional/shutdown/08-now1/flow.cylc
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,26 @@

[scheduling]
[[graph]]
R1 = t1:finish => t2
R1 = t1 => t2

[runtime]
[[t1]]
script = cylc__job__wait_cylc_message_started; cylc stop --now "${CYLC_WORKFLOW_ID}"
script = """
# wait for the started message to be sent
cylc__job__wait_cylc_message_started;
# issue the stop command
cylc stop --now "${CYLC_WORKFLOW_ID}"
# wait for the stop command to be recieved
cylc__job__poll_grep_workflow_log 'Command "stop" received'
# send a message telling the started handler to exit
cylc message -- stopping
"""
[[[events]]]
started handlers = sleep 10 && echo 'Hello %(id)s %(event)s'
# wait for the stopping message, sleep a bit, then echo some stuff
started handlers = """
cylc workflow-state %(workflow)s//%(point)s/%(name)s:stopping >/dev/null && sleep 1 && echo 'Hello %(id)s %(event)s'
"""
[[[outputs]]]
stopping = stopping
[[t2]]
script = true

0 comments on commit c734e7d

Please sign in to comment.