Skip to content

Commit

Permalink
Fix some func tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
hjoliver committed Dec 6, 2023
1 parent 365a9c7 commit 5fecd1a
Show file tree
Hide file tree
Showing 16 changed files with 27 additions and 26 deletions.
4 changes: 2 additions & 2 deletions tests/flakyfunctional/cylc-poll/16-execution-time-limit.t
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ __PYTHON__
LOG="${WORKFLOW_RUN_DIR}/log/scheduler/log"
# Test logging of the "next job poll" message when task starts.
TEST_NAME="${TEST_NAME_BASE}-log-entry"
LINE="$(grep '\[1/foo\ .* execution timeout=None, polling intervals=' "${LOG}")"
LINE="$(grep '\[1/foo.* execution timeout=None, polling intervals=' "${LOG}")"
run_ok "${TEST_NAME}" grep -q 'health: execution timeout=None, polling intervals=' <<< "${LINE}"
# Determine poll times.
PREDICTED_POLL_TIME=$(time_offset \
"$(cut -d ' ' -f 1 <<< "${LINE}")" \
"PT10S") # PT5S time limit + PT5S polling interval
ACTUAL_POLL_TIME=$(sed -n \
's|\(.*\) DEBUG - \[1/foo running .* (polled)failed .*|\1|p' "${LOG}")
's|\(.*\) DEBUG - \[1/foo.* (polled)failed .*|\1|p' "${LOG}")

# Test execution timeout polling.
# Main loop is roughly 1 second, but integer rounding may give an apparent 2
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/broadcast/07-timeout/flow.cylc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
[[timeout]]
script = """
cylc__job__poll_grep_workflow_log -E \
"${CYLC_TASK_ID} .* execution timeout after PT1S"
"${CYLC_TASK_ID}.* execution timeout after PT1S"
"""
[[[events]]]
execution timeout = PT1M
2 changes: 1 addition & 1 deletion tests/functional/cylc-cat-log/05-remote-tail.t
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ $SCP "${PWD}/bin/my-tailer.sh" \
# Run detached.
workflow_run_ok "${TEST_NAME_BASE}-run" cylc play "${WORKFLOW_NAME}"
#-------------------------------------------------------------------------------
poll_grep_workflow_log -E '1/foo preparing .* => submitted'
poll_grep_workflow_log -E '1/foo/01:preparing.* => submitted'
# cylc cat-log -m 't' tail-follows a file, so needs to be killed.
# Send interrupt signal to tail command after 15 seconds.
TEST_NAME="${TEST_NAME_BASE}-cat-log"
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/cylc-poll/13-comm-method.t
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ PRE_MSG='health:'
POST_MSG='.*, polling intervals=10\*PT6S...'
for INDEX in 1 2; do
for STAGE in 'submission' 'execution'; do
grep_ok "1/t${INDEX} .* ${PRE_MSG} ${STAGE}${POST_MSG}" "${LOG_FILE}" -E
grep_ok "1/t${INDEX}.* ${PRE_MSG} ${STAGE}${POST_MSG}" "${LOG_FILE}" -E
done
done
#-------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/cylc-poll/14-intervals.t
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ for INDEX in 1 2; do
POLL_INT='2\*PT1S,10\*PT6S,'
fi
POST_MSG=".*, polling intervals=${POLL_INT}..."
grep_ok "1/t${INDEX} .* ${PRE_MSG} ${STAGE}${POST_MSG}" "${LOG_FILE}" -E
grep_ok "1/t${INDEX}.*${PRE_MSG} ${STAGE}${POST_MSG}" "${LOG_FILE}" -E
done
done
#-------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/cylc-poll/15-job-st-file-no-batch.t
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ LOG="${WORKFLOW_RUN_DIR}/log/scheduler/log"
run_ok "${TEST_NAME_BASE}-log-1" \
grep -F '[jobs-poll err] 1/t1/01/job.status: incomplete job runner info' "${LOG}"
run_ok "${TEST_NAME_BASE}-log-2" \
grep -E '1/t1 running .*\(polled\)failed' "${LOG}"
grep -E '1/t1/01:running.*\(polled\)failed' "${LOG}"

purge
exit
6 changes: 3 additions & 3 deletions tests/functional/events/38-task-event-handler-custom.t
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ WORKFLOW_LOG="${WORKFLOW_RUN_DIR}/log/scheduler/log"
grep_ok \
"\[(('event-handler-00', 'custom-1'), 1) out\] !!CUSTOM!! 1/foo fugu Data ready for barring" \
"${FOO_ACTIVITY_LOG}"
grep_ok "1/foo .*Data ready for barring" "${WORKFLOW_LOG}" -E
grep_ok "1/foo .*Data ready for bazzing" "${WORKFLOW_LOG}" -E
grep_ok "1/foo .*Aren't the hydrangeas nice" "${WORKFLOW_LOG}" -E
grep_ok "1/foo.*Data ready for barring" "${WORKFLOW_LOG}" -E
grep_ok "1/foo.*Data ready for bazzing" "${WORKFLOW_LOG}" -E
grep_ok "1/foo.*Aren't the hydrangeas nice" "${WORKFLOW_LOG}" -E
purge
2 changes: 1 addition & 1 deletion tests/functional/hold-release/02-hold-on-spawn.t
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ workflow_run_ok "${TEST_NAME_BASE}-run" \
cylc release "${WORKFLOW_NAME}//1/foo"
# 1/foo should run and spawn 1/bar as waiting and held

poll_grep_workflow_log -E '1/bar .* spawned'
poll_grep_workflow_log -E '1/bar.* spawned'

sqlite3 "${WORKFLOW_RUN_DIR}/log/db" \
'SELECT cycle, name, status, is_held FROM task_pool' > task-pool.out
Expand Down
6 changes: 3 additions & 3 deletions tests/functional/intelligent-host-selection/02-badhosts.t
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ LOGFILE="${WORKFLOW_RUN_DIR}/log/scheduler/log"

# Check that badhosttask has submit failed, but not good or mixed
named_grep_ok "badhost task submit failed" \
"1/badhosttask .* submit-failed" "${LOGFILE}"
"1/badhosttask.* submit-failed" "${LOGFILE}"
named_grep_ok "goodhost suceeded" \
"1/mixedhosttask .* succeeded" "${LOGFILE}"
"1/mixedhosttask.* succeeded" "${LOGFILE}"
named_grep_ok "mixedhost task suceeded" \
"1/goodhosttask .* succeeded" "${LOGFILE}"
"1/goodhosttask.* succeeded" "${LOGFILE}"

# Check that when a task fail badhosts associated with that task's platform
# are removed from the badhosts set.
Expand Down
5 changes: 3 additions & 2 deletions tests/functional/reload/14-waiting/flow.cylc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

[scheduling]
[[graph]]
# SoD: starter:start addeded to create a partially satisfied waiting task
# SoD: starter:start added to create a partially satisfied waiting task
# to be present during the reload.
R1 = """
starter:start => waiter
Expand All @@ -23,8 +23,9 @@ done
script = true
[[reloader]]
script = """
cylc__job__wait_cylc_message_started
cylc reload "${CYLC_WORKFLOW_ID}"
cylc__job__poll_grep_workflow_log -E '1/waiter/01.* reloaded task definition'
cylc__job__poll_grep_workflow_log -E '1/waiter.* reloaded task definition'
rm -f "${CYLC_WORKFLOW_WORK_DIR}/1/sleeping-waiter/file"
rm -f "${CYLC_WORKFLOW_WORK_DIR}/1/starter/file"
"""
6 changes: 3 additions & 3 deletions tests/functional/reload/25-xtriggers.t
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ init_workflow "${TEST_NAME_BASE}" <<'__FLOW_CONFIG__'
[[reload]]
script = """
# wait for "broken" to fail
cylc__job__poll_grep_workflow_log '1/broken/01.* (received)failed/ERR'
cylc__job__poll_grep_workflow_log -E '1/broken/01.* \(received\)failed/ERR'
# fix "broken" to allow it to pass
sed -i 's/false/true/' "${CYLC_WORKFLOW_RUN_DIR}/flow.cylc"
# reload the workflow
Expand All @@ -63,7 +63,7 @@ workflow_run_ok "${TEST_NAME_BASE}-run" cylc play "${WORKFLOW_NAME}" --no-detach
log_scan "${TEST_NAME_BASE}-scan" \
"$(cylc cat-log -m p "${WORKFLOW_NAME}")" \
1 1 \
'1/broken .* (received)failed/ERR'
'1/broken.* (received)failed/ERR'

log_scan "${TEST_NAME_BASE}-scan" \
"$(cylc cat-log -m p "${WORKFLOW_NAME}")" 1 1 \
Expand All @@ -73,6 +73,6 @@ log_scan "${TEST_NAME_BASE}-scan" \
"$(cylc cat-log -m p "${WORKFLOW_NAME}")" \
1 1 \
'xtrigger satisfied: _cylc_retry_1/broken' \
'\[1/broken .* => succeeded'
'1/broken.* => succeeded'

purge
4 changes: 2 additions & 2 deletions tests/functional/remote/06-poll.t
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ log_scan \
"$(cylc cat-log -m p "$WORKFLOW_NAME")" \
10 \
1 \
'\[1/foo submitted .* (polled)foo' \
'\[1/foo .* (polled)succeeded'
'\[1/foo.* (polled)foo' \
'\[1/foo.* (polled)succeeded'

purge
exit
4 changes: 2 additions & 2 deletions tests/functional/restart/50-two-flows/flow.cylc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
[[a]]
script = """
if ((CYLC_TASK_FLOW_NUMBERS == 2)); then
cylc__job__poll_grep_workflow_log "\[1/c.* succeeded"
cylc__job__poll_grep_workflow_log -E "/c.* succeeded"
fi
"""
[[b, d]]
Expand All @@ -23,7 +23,7 @@
if ((CYLC_TASK_FLOW_NUMBERS == 1)); then
cylc trigger --flow=new --meta="cheese wizard" \
"$CYLC_WORKFLOW_ID//1/a"
cylc__job__poll_grep_workflow_log "\[1/a/02(2)submitted\] => running"
cylc__job__poll_grep_workflow_log -E "\[1/a/02\(2\):submitted\] => running"
cylc stop $CYLC_WORKFLOW_ID
fi
"""
2 changes: 1 addition & 1 deletion tests/functional/runahead/06-release-update.t
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ CYLC_RUN_PID="$!"
poll_workflow_running
YYYY="$(date +%Y)"
NEXT1=$(( YYYY + 1 ))
poll_grep_workflow_log -E "${NEXT1}/bar .* spawned"
poll_grep_workflow_log -E "${NEXT1}/bar.* spawned"

# sleep a little to allow the datastore to update (`cylc dump` sees the
# datastore) TODO can we avoid this flaky sleep somehow?
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/startup/00-state-summary.t
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ run_ok "${TEST_NAME}" cylc validate "${WORKFLOW_NAME}"
cylc play --no-detach "${WORKFLOW_NAME}" > /dev/null 2>&1
# Restart with a failed task and a succeeded task.
cylc play "${WORKFLOW_NAME}"
poll_grep_workflow_log -E '1/foo .* \(polled\)failed'
poll_grep_workflow_log -E '1/foo.* \(polled\)failed'
cylc dump "${WORKFLOW_NAME}" > dump.out
TEST_NAME=${TEST_NAME_BASE}-grep
# State summary should not just say "Initializing..."
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/xtriggers/03-sequence.t
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ run_ok "${TEST_NAME_BASE}-val" cylc validate "${WORKFLOW_NAME}"
# Run workflow; it will stall waiting on the never-satisfied xtriggers.
cylc play "${WORKFLOW_NAME}"

poll_grep_workflow_log -E '2025/start .* => succeeded'
poll_grep_workflow_log -E '2025/start.* => succeeded'

cylc show "${WORKFLOW_NAME}//2026/foo" | grep -E '^ - xtrigger' > 2026.foo.log

Expand Down

0 comments on commit 5fecd1a

Please sign in to comment.