From f95d7e397bc15b74a101019077714e68ce66e404 Mon Sep 17 00:00:00 2001 From: Matt Shin Date: Thu, 8 Aug 2019 16:09:19 +0100 Subject: [PATCH] Improve reference tests and related settings/logic User visible changes: * Removed settings: * `[cylc]log resolved dependencies` * `[cylc][[reference test]]*` except `expected task failures`. * Moved `[cylc]abort if any task fails` to `[cylc][[events]]abort if any task fails` so it lives with the other `abort if/on ...` settings. * Removed the `cylc check-triggering` command. * Log task trigger regardless, at level INFO. * Fixed `cylc submit` command - job unable to load `job.sh`. * Fixed `cylc run --stop-cycle-point=POINT` logic. * Ignore job poll message, when task is already in a *retrying* state. This fixes a flaky test in a busy environment when multiple messages and polls come in at quite a large interval - confusing the event manager. * Fixed: retrying held tasks should no longer be released for submission. Internal changes: * Cleaner reference test logic: * Detect reference test option automatically on shutdown. * Less logic required to deal with reference test configuration. * Remove the need to run an external command. * Generate a filtered test log in reference test - less loading/parsing. * Print only messages for reference/test log. (No more unnecessary date/time, level, etc in future reference logs.) * Parse reference/test logs on opened file handles instead of loading the full logs into memory. * Simplify abort on task failure logic. * Taking out various suite *timeout* settings in the tests that were causing instability in busy environments. Auto inject 3 minutes *inactivity* settings in reference tests. (The *timeout* setting relies on the suite to stall before timing out. The *inactivity* setting is better in this respect.) --- CHANGES.md | 9 ++ bin/cylc-check-triggering | 88 ----------- bin/cylc-help | 10 +- bin/cylc-submit | 5 + cylc/flow/cfgspec/suite.py | 42 +++--- cylc/flow/config.py | 20 +++ cylc/flow/etc/syntax/cylc.lang | 4 - cylc/flow/etc/syntax/cylc.xml | 5 - cylc/flow/exceptions.py | 4 - cylc/flow/log_diagnosis.py | 137 +++++------------- cylc/flow/loggingutil.py | 6 +- cylc/flow/pathutil.py | 5 + cylc/flow/scheduler.py | 112 ++++---------- cylc/flow/suite_events.py | 5 +- cylc/flow/task_events_mgr.py | 54 +++++-- cylc/flow/task_pool.py | 76 +++++----- cylc/flow/task_proxy.py | 46 +++--- cylc/flow/tests/test_pathutil.py | 3 + .../04-dummy-mode-output/suite.rc | 2 + .../cylc-kill/02-submitted.t | 0 .../cylc-kill/02-submitted/reference.log | 0 .../cylc-kill/02-submitted/suite.rc | 2 - flakytests/cylc-kill/test_header | 1 + flakytests/cylc-poll/03-poll-all/suite.rc | 2 - .../16-execution-time-limit/suite.rc | 2 +- flakytests/cylc-reset/02-output-1/suite.rc | 3 - flakytests/cylc-show/00-simple/reference.log | 1 + flakytests/cylc-show/00-simple/suite.rc | 24 ++- flakytests/cylc-take-checkpoints/00-basic.t | 2 +- flakytests/database/01-broadcast/suite.rc | 3 - flakytests/database/02-retry/suite.rc | 3 - flakytests/events/01-task.t | 6 +- flakytests/events/01-task/bin/log-check.sh | 21 --- flakytests/events/01-task/events.log | 14 +- flakytests/events/01-task/reference.log | 2 +- flakytests/events/01-task/suite.rc | 37 +++-- flakytests/events/05-timeout-ref-dummy.t | 2 +- .../events/05-timeout-ref-dummy/suite.rc | 7 +- .../events/39-task-event-template-all.t | 3 +- .../39-task-event-template-all/reference.log | 3 + .../39-task-event-template-all/suite.rc | 4 - .../00-background/suite.rc | 4 +- .../execution-time-limit/04-poll/suite.rc | 5 +- flakytests/hold-release/14-hold-kill/suite.rc | 40 +++-- .../hold-release/15-hold-after/suite.rc | 6 +- .../integer-cycling/00-satellite/suite.rc | 5 - .../job-submission/05-activity-log/suite.rc | 4 +- flakytests/modes/03-dummy-env/suite.rc | 8 +- flakytests/restart/03-retrying.t | 61 -------- .../03-retrying/bin/ctb-select-task-states | 42 ------ flakytests/restart/03-retrying/suite.rc | 38 ----- flakytests/restart/04-running.t | 61 -------- flakytests/restart/04-running/suite.rc | 29 ---- flakytests/restart/21-task-elapsed.t | 10 +- flakytests/restart/21-task-elapsed/suite.rc | 2 +- flakytests/restart/46-stop-clock-time.t | 8 + flakytests/restart/47-no-auto-stop.t | 2 +- flakytests/shutdown/02-no-dir.t | 6 +- flakytests/special/06-clock-triggered-iso.t | 2 +- .../00-get-graph-raw-1/suite.rc | 4 - .../01-get-graph-raw-2/suite.rc | 3 - .../02-get-graph-raw-3/suite.rc | 3 - .../03-get-graph-raw-4/suite.rc | 3 - tests/authentication/05-full-control.t | 10 +- .../09-remote-suite-same-name/suite.rc | 2 - .../10-remote-suite-passphrase-cache/suite.rc | 1 - tests/authentication/11-suite2-stop-suite1.t | 3 +- tests/broadcast/00-simple.t | 6 +- tests/broadcast/00-simple/bin/complog.py | 40 ----- tests/broadcast/00-simple/suite.rc | 3 - tests/broadcast/02-inherit/suite.rc | 3 - tests/broadcast/03-expire/suite.rc | 3 - tests/broadcast/04-empty/suite.rc | 4 - tests/broadcast/05-bad-point/suite.rc | 2 +- tests/broadcast/06-bad-namespace/suite.rc | 2 +- tests/broadcast/07-float-setting/suite.rc | 2 - tests/broadcast/08-space/suite.rc | 2 +- tests/broadcast/09-remote/suite.rc | 3 - tests/broadcast/10-file-1/suite.rc | 2 - tests/broadcast/11-file-2/suite.rc | 2 - tests/broadcast/12-file-stdin/suite.rc | 2 - tests/broadcast/13-file-cancel/suite.rc | 2 - tests/cli/02-now.t | 2 +- tests/clock-expire/00-basic/suite.rc | 2 +- tests/cyclers/36-icp_fcp_notation.t | 18 +-- .../cyclers/36-icp_fcp_notation/reference.log | 7 + tests/cyclers/360/suite.rc | 3 - tests/cyclers/365/suite.rc | 3 - tests/cyclers/366/suite.rc | 3 - .../cyclers/40-integer_exclusions_advanced.t | 41 ++---- tests/cyclers/aeon/suite.rc | 2 - tests/cyclers/day_of_week/suite.rc | 3 - tests/cyclers/integer1/suite.rc | 3 - .../integer_exclusions_advanced/suite.rc | 14 +- tests/cyclers/monthly/suite.rc | 2 - tests/cyclers/monthly_complex/suite.rc | 2 - tests/cyclers/multidaily/suite.rc | 2 - tests/cyclers/multidaily_local/suite.rc | 3 - tests/cyclers/multihourly/suite.rc | 2 - tests/cyclers/multimonthly/suite.rc | 2 - tests/cyclers/multiweekly/suite.rc | 2 - tests/cyclers/multiyearly/suite.rc | 2 - tests/cyclers/r1_initial_immortal/suite.rc | 2 - tests/cyclers/yearly/suite.rc | 2 - .../suite.rc | 4 - tests/cylc-cat-log/04-local-tail.t | 5 +- .../cylc-get-config/00-simple/section2.stdout | 26 ++-- tests/cylc-get-cylc-version/00-basic/suite.rc | 5 - tests/cylc-insert/00-insert/suite.rc | 3 - .../01-insert-bad-cycle-point/suite.rc | 3 - .../02-insert-bad-stop-cycle-point/suite.rc | 3 - tests/cylc-insert/03-insert-old/suite.rc | 3 - tests/cylc-insert/04-insert-family/suite.rc | 4 - tests/cylc-insert/05-insert-compat/suite.rc | 3 - .../06-insert-bad-cycle-point-compat/suite.rc | 3 - .../07-insert-bad-stop-cycle-point/suite.rc | 3 - .../08-insert-family-compat/suite.rc | 4 - .../09-insert-no-cycle-point/suite.rc | 3 - tests/cylc-insert/11-wildcard/suite.rc | 4 - .../cylc-insert/13-family-submit-num/suite.rc | 2 +- .../cylc-kill/00-multi-hosts-compat/suite.rc | 2 - tests/cylc-kill/01-multi-hosts/suite.rc | 2 - tests/cylc-message/00-ssh/suite.rc | 2 - tests/cylc-ping/simple/suite.rc | 4 - tests/cylc-poll/00-basic/suite.rc | 4 - tests/cylc-poll/01-task-failed/suite.rc | 2 - .../cylc-poll/02-task-submit-failed/suite.rc | 1 - tests/cylc-poll/04-poll-multi-hosts/suite.rc | 2 - .../cylc-poll/05-poll-multi-messages/suite.rc | 3 - tests/cylc-poll/06-loadleveler/suite.rc | 4 - tests/cylc-poll/07-pbs/suite.rc | 4 - tests/cylc-poll/08-slurm/suite.rc | 4 - tests/cylc-poll/09-lsf/suite.rc | 4 - tests/cylc-poll/10-basic-compat/suite.rc | 4 - tests/cylc-poll/11-event-time/suite.rc | 5 - tests/cylc-poll/13-comm-method/suite.rc | 4 - tests/cylc-poll/14-intervals/suite.rc | 4 - tests/cylc-poll/17-pbs-cant-connect/suite.rc | 5 - tests/cylc-remove/00-simple/suite.rc | 2 - tests/cylc-remove/01-simple-comat/suite.rc | 2 - tests/cylc-remove/02-cycling/suite.rc | 3 - tests/cylc-reset/00-compat/suite.rc | 2 - tests/cylc-reset/01-filter-failed/suite.rc | 2 - tests/cylc-reset/03-output-2/suite.rc | 11 +- tests/cylc-scan/03-monitor.t | 9 +- tests/cylc-submit/11-multi.t | 1 + tests/cylc-trigger/02-filter-failed/suite.rc | 2 - tests/cylc-trigger/04-filter-names/suite.rc | 2 - tests/cylc-trigger/05-filter-cycles/suite.rc | 2 - tests/cylc-trigger/06-reset-ready/suite.rc | 2 - tests/database/03-remote/suite.rc | 2 - tests/database/04-lock-recover/suite.rc | 3 - tests/database/05-lock-recover-100/suite.rc | 3 - tests/database/06-task-message/suite.rc | 3 - tests/directives/at/suite.rc | 2 - tests/directives/loadleveler/suite.rc | 2 - tests/directives/pbs/suite.rc | 2 - tests/directives/slurm/suite.rc | 2 - tests/events/04-timeout-ref-live.t | 2 +- tests/events/06-timeout-ref-simulation.t | 2 +- .../08-task-event-handler-retry/suite.rc | 4 - tests/events/09-task-event-mail/suite.rc | 2 - .../10-task-event-job-logs-retrieve/suite.rc | 4 - .../suite.rc | 2 - .../suite.rc | 4 - tests/events/18-suite-event-mail/suite.rc | 5 +- tests/events/20-suite-event-handlers/suite.rc | 2 - .../events/23-suite-stalled-handler/suite.rc | 3 +- tests/events/24-abort-on-stalled/suite.rc | 3 +- .../26-suite-stalled-dump-prereq/suite.rc | 3 +- .../27-suite-stalled-dump-prereq-fam/suite.rc | 3 +- tests/events/28-inactivity/suite.rc | 2 - tests/events/29-task-event-mail-1/suite.rc | 2 - tests/events/30-task-event-mail-2/suite.rc | 1 - .../suite.rc | 4 - .../suite.rc | 1 - tests/events/34-task-abort.t | 22 ++- tests/events/34-task-abort/reference.log | 3 + tests/events/34-task-abort/suite.rc | 7 +- .../suite.rc | 4 - .../suite.rc | 2 - .../38-task-event-handler-custom/suite.rc | 4 - tests/events/44-timeout.t | 10 +- tests/events/47-long-output.t | 16 +- tests/events/48-suite-aborted/suite.rc | 2 - .../events/50-ref-test-fail.t | 48 +++--- tests/events/50-ref-test-fail/reference.log | 4 + tests/events/50-ref-test-fail/suite.rc | 6 + tests/events/suite/suite.rc | 3 - tests/events/timeout-ref/suite.rc | 7 +- tests/execution-time-limit/02-slurm/suite.rc | 5 - tests/ext-trigger/00-satellite/suite.rc | 3 - .../graph-equivalence/multiline_and1/suite.rc | 4 - .../graph-equivalence/multiline_and2/suite.rc | 4 - tests/graph-equivalence/test1/suite.rc | 4 - tests/graph-equivalence/test2/suite.rc | 4 - tests/graph-equivalence/test3/suite.rc | 4 - tests/graphql/01-workflow.t | 4 +- tests/graphql/02-root-queries.t | 4 +- tests/hold-release/11-retrying/suite.rc | 6 - .../hold-release/12-hold-then-retry/suite.rc | 8 +- .../hold-release/18-hold-cycle-globs/suite.rc | 3 - .../19-no-reset-prereq-on-waiting/suite.rc | 3 - tests/hold-release/beyond-stop/suite.rc | 2 - tests/hold-release/hold-after-point/suite.rc | 2 - tests/hold-release/hold-family/suite.rc | 2 - tests/hold-release/hold-on-spawn/suite.rc | 2 - tests/hold-release/hold-task/suite.rc | 2 - tests/hold-release/release-family/suite.rc | 2 - tests/hold-release/release-task/suite.rc | 2 - tests/hold-release/run-hold-after/suite.rc | 2 - tests/hold-release/suite/suite.rc | 2 - tests/host-select/00-simple/bin/cleanup.sh | 9 -- tests/host-select/00-simple/suite.rc | 4 - tests/host-select/01-timeout/suite.rc | 2 - tests/intercycle/future/suite.rc | 4 - tests/intercycle/past/suite.rc | 2 - tests/jinja2/commandline-set/suite.rc | 3 - tests/job-file-trap/01-loadleveler/suite.rc | 5 - tests/job-file-trap/02-pipefail/suite.rc | 5 +- tests/job-kill/00-local/suite.rc | 2 - tests/job-kill/01-remote/suite.rc | 2 - tests/job-kill/02-loadleveler/suite.rc | 2 - tests/job-kill/03-slurm/suite.rc | 2 - tests/job-kill/04-pbs/suite.rc | 2 - tests/job-submission/00-user/suite.rc | 6 - .../01-job-nn-localhost/suite.rc | 2 - tests/job-submission/06-garbage/suite.rc | 2 - tests/job-submission/07-multi/suite.rc | 3 - .../08-activity-log-host/suite.rc | 3 - .../09-activity-log-host-bad-submit/suite.rc | 2 - tests/job-submission/10-at-shell/suite.rc | 5 - .../11-garbage-host-command/suite.rc | 2 - .../12-tidy-submits-of-prev-run/suite.rc | 5 - tests/job-submission/16-timeout/suite.rc | 4 - .../17-remote-localtime/suite.rc | 2 - tests/jobscript/00-torture/suite.rc | 6 - .../suite.rc | 6 - .../04-global-initial-scripting/suite.rc | 6 - tests/jobscript/05-global-config/suite.rc | 5 - tests/jobscript/17-envfail/suite.rc | 3 +- tests/jobscript/cycling/suite.rc | 4 - tests/lib/bash/test_header | 16 +- tests/logging/02-duplicates.t | 32 ++-- tests/logging/02-duplicates/suite.rc | 25 +--- tests/message-triggers/02-action/suite.rc | 44 ++++-- tests/modes/dummy-message-outputs/suite.rc | 4 +- tests/modes/dummy/suite.rc | 3 +- tests/modes/simulation/suite.rc | 2 - tests/offset/00-final-simple/suite.rc | 3 - tests/offset/01-final-next/suite.rc | 7 +- tests/offset/02-final-chain/suite.rc | 3 - tests/offset/03-final-next-chain/suite.rc | 3 - tests/offset/04-cycle-offset-chain/suite.rc | 3 - tests/offset/05-long-final-chain/suite.rc | 3 - tests/param_expand/03-env-tmpl/suite.rc | 2 - tests/periodicals/Daily/suite.rc | 3 - tests/periodicals/Monthly-reorder/suite.rc | 3 - tests/periodicals/Monthly/suite.rc | 3 - tests/periodicals/Yearly/suite.rc | 3 - .../pre-initial/advanced-conditional/suite.rc | 3 - tests/pre-initial/basic-conditional/suite.rc | 3 - .../conditional-messaging/suite.rc | 2 - tests/pre-initial/drop-conditional/suite.rc | 3 - tests/pre-initial/simple-messaging/suite.rc | 3 - tests/pre-initial/simple/suite.rc | 3 - tests/pre-initial/warm-insert-stall/suite.rc | 2 - tests/pre-initial/warm-insert/suite.rc | 2 - tests/pre-initial/warm-offset/suite.rc | 3 - tests/pre-initial/warm-start-iso/suite.rc | 3 - tests/pre-initial/warm-start/suite.rc | 3 - tests/queues/qsize/suite.rc | 6 +- tests/recurrence-min/00-basic/suite.rc | 3 - .../recurrence-min/01-offset-initial/suite.rc | 3 - .../02-offset-truncated/suite.rc | 3 - .../03-neg-offset-truncated/suite.rc | 3 - tests/registration/02-on-the-fly.t | 10 +- tests/reload/11-retrying.t | 17 +-- tests/reload/14-waiting/suite.rc | 6 - tests/reload/17-graphing-change.t | 56 ++++--- tests/reload/18-broadcast-insert/suite-2.rc | 4 - tests/reload/18-broadcast-insert/suite.rc | 4 - tests/reload/19-remote-kill/suite.rc | 2 - tests/reload/20-stop-point/suite.rc | 3 - tests/reload/21-submit-fail/suite.rc | 2 - tests/reload/add-task/suite.rc | 5 - tests/reload/content/suite.rc | 5 - tests/reload/cycle-times/suite.rc | 3 - tests/reload/final-cycle/suite.rc | 3 - tests/reload/garbage/suite.rc | 5 - tests/reload/graphing-change/suite-1.rc | 2 +- tests/reload/graphing-change/suite-2.rc | 2 +- tests/reload/graphing-change/suite.rc | 2 +- tests/reload/graphing-fam/suite.rc | 5 - tests/reload/graphing-simple/suite.rc | 5 - tests/reload/inheritance/suite.rc | 5 - tests/reload/queues/suite.rc | 5 - tests/reload/remove-add-alter-task/suite.rc | 3 - tests/reload/remove-task/suite.rc | 5 - tests/reload/retrying/reference.log | 10 +- tests/reload/retrying/suite.rc | 33 +++-- tests/reload/simple/suite.rc | 4 - tests/reload/startup/suite.rc | 3 - tests/remote/basic/bin/cleanup.sh | 9 -- tests/remote/basic/suite.rc | 5 - tests/restart/00-pre-initial/suite.rc | 5 +- tests/restart/03-retrying.t | 58 ++++++++ tests/restart/04-running.t | 60 ++++++++ tests/restart/10-pre-initial-2.t | 28 ++-- tests/restart/16-template-vars/suite.rc | 3 - .../18-template-vars-override/suite.rc | 3 - tests/restart/23-hold-retry.t | 40 ++--- tests/restart/23-hold-retry/suite.rc | 23 +-- tests/restart/25-hold-suite.t | 43 +++--- tests/restart/25-hold-suite/suite.rc | 2 +- tests/restart/33-simulation.t | 2 +- tests/restart/42-auto-restart-ping-pong.t | 10 +- .../43-auto-restart-force-override-normal.t | 10 +- tests/restart/bad-job-host/suite.rc | 2 +- tests/restart/broadcast/suite.rc | 2 +- tests/restart/pre-init-2/suite.rc | 5 - tests/restart/reload/suite.rc | 3 - tests/retries/00-execution-retry.t | 26 ++-- tests/retries/01-submission-retry.t | 25 ++-- tests/retries/execution/suite.rc | 14 +- tests/retries/submission/suite.rc | 9 +- tests/rnd/02-lib-python-in-job/suite.rc | 3 +- tests/runahead/06-release-update.t | 36 +++-- tests/runahead/release-update/suite.rc | 5 +- tests/shutdown/00-cycle/suite.rc | 2 - tests/shutdown/01-task/suite.rc | 2 - tests/shutdown/04-kill/suite.rc | 2 - tests/shutdown/07-task-fail/suite.rc | 2 +- tests/shutdown/08-now1/suite.rc | 5 +- .../shutdown/12-bad-port-file-check/suite.rc | 2 +- tests/shutdown/13-no-port-file-check/suite.rc | 2 +- tests/shutdown/14-no-dir-check/suite.rc | 2 +- tests/shutdown/18-client-on-dead-suite.t | 9 +- tests/shutdown/19-log-reference.t | 16 +- tests/spawn-max/00-basic/suite.rc | 1 - tests/special/exclude/suite.rc | 4 - tests/special/include/suite.rc | 4 - tests/special/sequential/suite.rc | 3 - tests/suite-host-self-id/00-address.t | 2 +- tests/suite-host-self-id/00-address/suite.rc | 11 -- tests/suite-state/format/suite.rc | 2 - tests/suite-state/message/suite.rc | 2 - tests/suite-state/options/suite.rc | 2 - tests/suite-state/polling/suite.rc | 3 - tests/suite-state/template/suite.rc | 2 - tests/suite-state/template_ref/suite.rc | 2 - tests/suite-state/upstream/suite.rc | 4 +- tests/task-name/00-basic/suite.rc | 3 - tests/triggering/fail/suite.rc | 3 - tests/triggering/fam-fail-all/suite.rc | 3 - tests/triggering/fam-fail-any/suite.rc | 3 - tests/triggering/fam-finish-all/suite.rc | 3 - tests/triggering/fam-finish-any/suite.rc | 5 - tests/triggering/fam-start-all/suite.rc | 5 - tests/triggering/fam-succeed-all/suite.rc | 5 - tests/triggering/fam-succeed-any/suite.rc | 3 - tests/triggering/finish/suite.rc | 5 +- tests/triggering/or-condition/suite.rc | 5 - tests/triggering/recovery/suite.rc | 1 - tests/triggering/start/suite.rc | 5 - tests/triggering/submit-fail/suite.rc | 3 - tests/triggering/submit/suite.rc | 5 - tests/triggering/succeed/suite.rc | 5 - tests/triggering/suicide/suite.rc | 2 - tests/validate/00-multi/suite.rc | 4 - tests/validate/01-periodical/suite.rc | 4 - .../24-fail-initial-greater-final/suite.rc | 4 +- tests/validate/31-fail-not-integer.t | 1 - 373 files changed, 919 insertions(+), 1999 deletions(-) delete mode 100755 bin/cylc-check-triggering rename {tests => flakytests}/cylc-kill/02-submitted.t (100%) rename {tests => flakytests}/cylc-kill/02-submitted/reference.log (100%) rename {tests => flakytests}/cylc-kill/02-submitted/suite.rc (90%) create mode 120000 flakytests/cylc-kill/test_header delete mode 100755 flakytests/events/01-task/bin/log-check.sh create mode 100644 flakytests/events/39-task-event-template-all/reference.log delete mode 100755 flakytests/restart/03-retrying.t delete mode 100755 flakytests/restart/03-retrying/bin/ctb-select-task-states delete mode 100644 flakytests/restart/03-retrying/suite.rc delete mode 100755 flakytests/restart/04-running.t delete mode 100644 flakytests/restart/04-running/suite.rc delete mode 100755 tests/broadcast/00-simple/bin/complog.py create mode 100644 tests/cyclers/36-icp_fcp_notation/reference.log create mode 100644 tests/events/34-task-abort/reference.log rename flakytests/restart/04-running/bin/ctb-select-task-states => tests/events/50-ref-test-fail.t (56%) create mode 100644 tests/events/50-ref-test-fail/reference.log create mode 100644 tests/events/50-ref-test-fail/suite.rc delete mode 100755 tests/host-select/00-simple/bin/cleanup.sh delete mode 100755 tests/remote/basic/bin/cleanup.sh create mode 100755 tests/restart/03-retrying.t create mode 100755 tests/restart/04-running.t diff --git a/CHANGES.md b/CHANGES.md index 79ab5c3a76d..ca28549fd5d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -161,6 +161,15 @@ variable `ISODATETIMEREF` (reference time for the `isodatetime` command from [metomi-isodatetime](https://github.com/metomi/isodatetime/)) in task jobs to have the same value as `CYLC_TASK_CYCLE_POINT`. +[#3286](https://github.com/cylc/cylc-flow/pull/3249) - +Removed the `cylc check-triggering` command. +Changed the `suite.rc` schema: +* Removed `[cylc]log resolved dependencies` +* Removed `[cylc][[reference test]]*` except `expected task failures`. +* Moved `[cylc]abort if any task fails` to + `[cylc][[events]]abort if any task fails` so it lives with the other + `abort if/on ...` settings. + ### Fixes [#3258](https://github.com/cylc/cylc-flow/pull/3258) - leave '%'-escaped string diff --git a/bin/cylc-check-triggering b/bin/cylc-check-triggering deleted file mode 100755 index 58a0b5d5be9..00000000000 --- a/bin/cylc-check-triggering +++ /dev/null @@ -1,88 +0,0 @@ -#!/usr/bin/env python3 - -# THIS FILE IS PART OF THE CYLC SUITE ENGINE. -# Copyright (C) 2008-2019 NIWA & British Crown (Met Office) & Contributors. -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -"""cylc [hook] check-triggering ARGS - -This is a cylc shutdown event handler that compares the newly generated -suite log with a previously generated reference log "reference.log" -stored in the suite definition directory. Currently it just compares -runtime triggering information, disregarding event order and timing, and -fails the suite if there is any difference. This should be sufficient to -verify correct scheduling of any suite that is not affected by different -run-to-run conditional triggering. - -1) run your suite with "cylc run --generate-reference-log" to generate -the reference log with resolved triggering information. Check manually -that the reference run was correct. -2) run reference tests with "cylc run --reference-test" - this -automatically sets the shutdown event handler along with a suite timeout -and "abort if shutdown handler fails", "abort on timeout", and "abort if -any task fails". - -Reference tests can use any run mode: - * simulation mode - tests that scheduling is equivalent to the reference - * dummy mode - also tests that task hosting, job submission, job script - evaluation, and cylc messaging are not broken. - * live mode - tests everything (but takes longer with real tasks!) - - If any task fails, or if cylc itself fails, or if triggering is not - equivalent to the reference run, the test will abort with non-zero exit - status - so reference tests can be used as automated tests to check - that changes to cylc have not broken your suites.""" - -import os -import sys - -from cylc.flow.log_diagnosis import LogAnalyser -from cylc.flow.terminal import cli_function - - -@cli_function(None) -def main(): - if len(sys.argv) == 2 and sys.argv[1] == '--help': - print(__doc__) - sys.exit(0) - - print("\nThis is the cylc check-triggering shutdown event handler") - - event, suite = sys.argv[1], sys.argv[2] - - if event != 'shutdown': - raise SystemExit("ERROR: run this as a shutdown event handler") - - try: - log_dir = os.path.expandvars(os.environ['CYLC_SUITE_LOG_DIR']) - suite_dir = os.path.expandvars(os.environ['CYLC_SUITE_DEF_PATH']) - except KeyError as exc: - raise SystemExit(exc) - - new_log = os.path.join(log_dir, 'log') - ref_log = os.path.join(suite_dir, 'reference.log') - - try: - lanal = LogAnalyser(new_log, ref_log) - lanal.verify_triggering() - except Exception as exc: - print(exc, file=sys.stderr) - raise SystemExit("ERROR: Triggering check FAILED") - else: - print("Triggering check passed") - - -if __name__ == '__main__': - main() diff --git a/bin/cylc-help b/bin/cylc-help index dd7d6480114..7c55b224ba0 100755 --- a/bin/cylc-help +++ b/bin/cylc-help @@ -71,7 +71,6 @@ def match_command(abbrev): discovery_commands, control_commands, utility_commands, - hook_commands, task_commands]: for com, aliases in dct.items(): if any(alias == abbrev for alias in aliases): @@ -262,9 +261,6 @@ utility_commands['ls-checkpoints'] = ['ls-checkpoints'] utility_commands['report-timings'] = ['report-timings'] utility_commands['function-run'] = ['function-run'] -hook_commands = {} -hook_commands['check-triggering'] = ['check-triggering'] - admin_commands = {} admin_commands['check-software'] = ['check-software'] @@ -304,8 +300,7 @@ for dct in [ control_commands, utility_commands, task_commands, - admin_commands, - hook_commands]: + admin_commands]: all_commands.update(dct) # topic summaries @@ -394,9 +389,6 @@ comsum['ls-checkpoints'] = 'Display task pool etc at given events' comsum['report-timings'] = 'Generate a report on task timing data' comsum['function-run'] = '(Internal) Run a function in the process pool' -# hook -comsum['check-triggering'] = 'A suite shutdown event hook for cylc testing' - def help_func(): # no arguments: print help and exit diff --git a/bin/cylc-submit b/bin/cylc-submit index c493c205644..b5a08e4a77c 100755 --- a/bin/cylc-submit +++ b/bin/cylc-submit @@ -50,6 +50,7 @@ from cylc.flow.suite_db_mgr import SuiteDatabaseManager from cylc.flow.broadcast_mgr import BroadcastMgr from cylc.flow.hostuserutil import get_user from cylc.flow.job_pool import JobPool +from cylc.flow.resources import extract_resources from cylc.flow.suite_srv_files_mgr import SuiteSrvFilesManager from cylc.flow.task_id import TaskID from cylc.flow.task_job_mgr import TaskJobManager @@ -113,6 +114,10 @@ def main(parser, options, suite, *task_ids): # Initialise job submit environment make_suite_run_tree(suite) + # Extract job.sh from library, for use in job scripts. + extract_resources( + suite_srv_mgr.get_suite_srv_dir(suite), + ['etc/job.sh']) pool = SubProcPool() owner = get_user() job_pool = JobPool(suite, owner) diff --git a/cylc/flow/cfgspec/suite.py b/cylc/flow/cfgspec/suite.py index 76f1ff137d9..31d38776ab4 100644 --- a/cylc/flow/cfgspec/suite.py +++ b/cylc/flow/cfgspec/suite.py @@ -49,10 +49,8 @@ VDR.V_STRING, '', 'live', 'dummy', 'dummy-local', 'simulation'], 'force run mode': [ VDR.V_STRING, '', 'live', 'dummy', 'dummy-local', 'simulation'], - 'abort if any task fails': [VDR.V_BOOLEAN], 'health check interval': [VDR.V_INTERVAL], 'task event mail interval': [VDR.V_INTERVAL], - 'log resolved dependencies': [VDR.V_BOOLEAN], 'disable automatic shutdown': [VDR.V_BOOLEAN], 'simulation': { 'disable suite event handlers': [VDR.V_BOOLEAN, True], @@ -82,6 +80,7 @@ 'abort if timeout handler fails': [VDR.V_BOOLEAN], 'abort if inactivity handler fails': [VDR.V_BOOLEAN], 'abort if stalled handler fails': [VDR.V_BOOLEAN], + 'abort if any task fails': [VDR.V_BOOLEAN], 'abort on stalled': [VDR.V_BOOLEAN], 'abort on timeout': [VDR.V_BOOLEAN], 'abort on inactivity': [VDR.V_BOOLEAN], @@ -92,21 +91,7 @@ 'mail footer': [VDR.V_STRING], }, 'reference test': { - 'suite shutdown event handler': [ - VDR.V_STRING, 'cylc hook check-triggering'], - 'required run mode': [ - VDR.V_STRING, - '', 'live', 'simulation', 'dummy-local', 'dummy'], - 'allow task failures': [VDR.V_BOOLEAN], 'expected task failures': [VDR.V_STRING_LIST], - 'live mode suite timeout': [ - VDR.V_INTERVAL, DurationFloat(60)], - 'dummy mode suite timeout': [ - VDR.V_INTERVAL, DurationFloat(60)], - 'dummy-local mode suite timeout': [ - VDR.V_INTERVAL, DurationFloat(60)], - 'simulation mode suite timeout': [ - VDR.V_INTERVAL, DurationFloat(60)], }, 'authentication': { # Allow owners to grant public shutdown rights at the most, not @@ -176,7 +161,7 @@ 'simulation': { 'default run length': [VDR.V_INTERVAL, DurationFloat(10)], 'speedup factor': [VDR.V_FLOAT], - 'time limit buffer': [VDR.V_INTERVAL, DurationFloat(10)], + 'time limit buffer': [VDR.V_INTERVAL, DurationFloat(30)], 'fail cycle points': [VDR.V_STRING_LIST], 'fail try 1 only': [VDR.V_BOOLEAN, True], 'disable task event handlers': [VDR.V_BOOLEAN, True], @@ -285,11 +270,30 @@ def upg(cfg, descr): u.obsolete('7.2.2', ['runtime', '__MANY__', 'dummy mode']) u.obsolete('7.2.2', ['runtime', '__MANY__', 'simulation mode']) u.obsolete('7.6.0', ['runtime', '__MANY__', 'enable resurrection']) - u.obsolete('7.8.0', ['runtime', '__MANY__', 'suite state polling', - 'template']) + u.obsolete( + '7.8.0', + ['runtime', '__MANY__', 'suite state polling', 'template']) u.obsolete('7.8.1', ['cylc', 'events', 'reset timer']) u.obsolete('7.8.1', ['cylc', 'events', 'reset inactivity timer']) u.obsolete('7.8.1', ['runtime', '__MANY__', 'events', 'reset timer']) + u.obsolete('8.0.0', ['cylc', 'log resolved dependencies']) + u.obsolete('8.0.0', ['cylc', 'reference test', 'allow task failures']) + u.obsolete('8.0.0', ['cylc', 'reference test', 'live mode suite timeout']) + u.obsolete('8.0.0', ['cylc', 'reference test', 'dummy mode suite timeout']) + u.obsolete( + '8.0.0', + ['cylc', 'reference test', 'dummy-local mode suite timeout']) + u.obsolete( + '8.0.0', + ['cylc', 'reference test', 'simulation mode suite timeout']) + u.obsolete('8.0.0', ['cylc', 'reference test', 'required run mode']) + u.obsolete( + '8.0.0', + ['cylc', 'reference test', 'suite shutdown event handler']) + u.deprecate( + '8.0.0', + ['cylc', 'abort if any task fails'], + ['cylc', 'events', 'abort if any task fails']) u.obsolete('8.0.0', ['runtime', '__MANY__', 'job', 'shell']) u.upgrade() diff --git a/cylc/flow/config.py b/cylc/flow/config.py index 26e97a03b01..9a00b412049 100644 --- a/cylc/flow/config.py +++ b/cylc/flow/config.py @@ -2256,3 +2256,23 @@ def _get_taskdef(self, name): def describe(self, name): """Return title and description of the named task.""" return self.taskdefs[name].describe() + + def get_ref_log_name(self): + """Return path to reference log (for reference test).""" + return os.path.join(self.fdir, 'reference.log') + + def get_expected_failed_tasks(self): + """Return list of expected failed tasks. + + Return: + - An empty list if NO task is expected to fail. + - A list of NAME.CYCLE for the tasks that are expected to fail + in reference test mode. + - None if there is no expectation either way. + """ + if self.options.reftest: + return self.cfg['cylc']['reference test']['expected task failures'] + elif self.cfg['cylc']['events']['abort if any task fails']: + return [] + else: + return None diff --git a/cylc/flow/etc/syntax/cylc.lang b/cylc/flow/etc/syntax/cylc.lang index d22f7228610..8c19693c38f 100644 --- a/cylc/flow/etc/syntax/cylc.lang +++ b/cylc/flow/etc/syntax/cylc.lang @@ -110,7 +110,6 @@ startup handler started handler stalled handler - simulation mode suite timeout disable suite event handlers default run length speedup factor @@ -143,8 +142,6 @@ mail retry delays mail from mail events - log resolved dependencies - live mode suite timeout limit interval initial cycle point constraints @@ -190,7 +187,6 @@ clock-expire batch system batch submit command template - allow task failures abort on timeout abort on stalled abort on inactivity diff --git a/cylc/flow/etc/syntax/cylc.xml b/cylc/flow/etc/syntax/cylc.xml index 50d436bf8c3..ad3b37b95d3 100644 --- a/cylc/flow/etc/syntax/cylc.xml +++ b/cylc/flow/etc/syntax/cylc.xml @@ -37,7 +37,6 @@ - @@ -70,8 +69,6 @@ - - @@ -104,7 +101,6 @@ - @@ -118,7 +114,6 @@ - diff --git a/cylc/flow/exceptions.py b/cylc/flow/exceptions.py index 6546d08187c..b529fa70365 100644 --- a/cylc/flow/exceptions.py +++ b/cylc/flow/exceptions.py @@ -38,10 +38,6 @@ class UserInputError(CylcError): """ -class LogAnalyserError(CylcError): - """Exception for issues scraping Cylc suite log files.""" - - class CylcConfigError(CylcError): """Generic exception to handle an error in a Cylc configuration file. diff --git a/cylc/flow/log_diagnosis.py b/cylc/flow/log_diagnosis.py index 0552ce6a272..3019b7e276e 100644 --- a/cylc/flow/log_diagnosis.py +++ b/cylc/flow/log_diagnosis.py @@ -15,111 +15,42 @@ # # You should have received a copy of the GNU General Public License # along with this program. If not, see . +"""Run reference test.""" -import re from difflib import unified_diff +import re from cylc.flow import LOG -from cylc.flow.exceptions import LogAnalyserError - - -class LogSpec(object): - """Get important information from an existing reference run log - file, in order to do the same run for a reference test. Currently - just gets the start and stop cycle points.""" - - def __init__(self, log): - h = open(log, 'r') - self.lines = h.readlines() - h.close() - - def get_initial_point_string(self): - found = False - for line in self.lines: - m = re.search('Initial point: (.*)$', line) - if m: - found = True - point_string = m.groups()[0] - if point_string == "None": - point_string = None - break - if found: - return point_string - else: - raise LogAnalyserError("logged start point not found") - - def get_start_point_string(self): - found = False - for line in self.lines: - m = re.search('Start point: (.*)$', line) - if m: - found = True - point_string = m.groups()[0] - if point_string == "None": - point_string = None - break - if found: - return point_string - return None - - def get_final_point_string(self): - found = False - for line in self.lines: - m = re.search('Final point: (.*)$', line) - if m: - found = True - point_string = m.groups()[0] - if point_string == "None": - return None - break - if found: - return point_string - else: - raise LogAnalyserError("logged stop point not found") - - -class LogAnalyser(object): - """Compare an existing reference log with the log from a new - reference test run. Currently just compares triggering info.""" - - def __init__(self, new_log, ref_log): - h = open(new_log, 'r') - self.new_loglines = h.readlines() - h.close() - h = open(ref_log, 'r') - self.ref_loglines = h.readlines() - h.close() - - @staticmethod - def get_triggered(lines): - res = [] - for line in lines: - m = re.search(r'INFO - (\[.* -triggered off .*)$', line) - if m: - res.append(m.groups()[0]) - return res - - def verify_triggering(self): - new = self.get_triggered(self.new_loglines) - ref = self.get_triggered(self.ref_loglines) - - if len(new) == 0: - raise LogAnalyserError( - "new log contains no triggering info.") - - if len(ref) == 0: - raise LogAnalyserError( - "reference log contains no triggering info.") - - new.sort() - ref.sort() - - if new != ref: - diff = unified_diff(new, ref, 'this run', 'reference log') - raise LogAnalyserError( - "triggering is NOT consistent with the reference log:" + - '\n' + '\n'.join(diff) + '\n') - else: - LOG.info( - "LogAnalyser: triggering is consistent with the reference log") +from cylc.flow.exceptions import SuiteEventError +from cylc.flow.pathutil import get_suite_test_log_name + + +def run_reftest(config, ctx): + """Run reference test at shutdown.""" + reffilename = config.get_ref_log_name() + curfilename = get_suite_test_log_name(ctx.suite) + ref = _load_reflog(reffilename) + cur = _load_reflog(curfilename) + if ref == cur: + LOG.info('SUITE REFERENCE TEST PASSED') + else: + exc = SuiteEventError( + 'SUITE REFERENCE TEST FAILED\n' + 'triggering is NOT consistent with the reference log:\n%s\n' + % '\n'.join(unified_diff(ref, cur, 'reference', 'this run')) + ) + LOG.exception(exc) + raise exc + + +def _load_reflog(filename): + """Reference test: get trigger info from reference log.""" + res = [] + re_trig = re.compile(r'(\[.+\]\s-triggered\soff\s\[.+\])$') + for line in open(filename, 'r'): + match = re_trig.search(line) + if match: + res.append(match.groups()[0]) + res.sort() + return res diff --git a/cylc/flow/loggingutil.py b/cylc/flow/loggingutil.py index c084800e0d8..c76bad75703 100644 --- a/cylc/flow/loggingutil.py +++ b/cylc/flow/loggingutil.py @@ -207,8 +207,12 @@ class ReferenceLogFileHandler(logging.FileHandler): def __init__(self, filename): """Create the reference log file handler, specifying the file to write the reference log lines.""" + try: + os.unlink(filename) + except OSError: + pass super().__init__(filename) - self.formatter = CylcLogFormatter() + self.formatter = logging.Formatter('%(message)s') self.addFilter(self._filter) def _filter(self, record): diff --git a/cylc/flow/pathutil.py b/cylc/flow/pathutil.py index 678b294995f..ba4404ae967 100644 --- a/cylc/flow/pathutil.py +++ b/cylc/flow/pathutil.py @@ -88,6 +88,11 @@ def get_suite_run_work_dir(suite, *args): glbl_cfg().get_host_item('work directory'), suite, 'work', *args) +def get_suite_test_log_name(suite): + """Return suite run ref test log file path.""" + return get_suite_run_dir(suite, 'log', 'suite', 'reftest.log') + + def make_suite_run_tree(suite): """Create all top-level cylc-run output dirs on the suite host.""" cfg = glbl_cfg().get() diff --git a/cylc/flow/scheduler.py b/cylc/flow/scheduler.py index fd61dd0f57a..d81be8f469a 100644 --- a/cylc/flow/scheduler.py +++ b/cylc/flow/scheduler.py @@ -32,7 +32,6 @@ from uuid import uuid4 from metomi.isodatetime.parsers import TimePointParser -from cylc.flow.parsec.util import printcfg from cylc.flow import LOG from cylc.flow.broadcast_mgr import BroadcastMgr @@ -48,14 +47,16 @@ from cylc.flow.job_pool import JobPool from cylc.flow.loggingutil import TimestampRotatingFileHandler,\ ReferenceLogFileHandler -from cylc.flow.log_diagnosis import LogSpec from cylc.flow.network.server import SuiteRuntimeServer +from cylc.flow.parsec.util import printcfg +from cylc.flow.parsec.validate import DurationFloat from cylc.flow.pathutil import ( get_suite_run_dir, get_suite_run_log_dir, get_suite_run_rc_dir, get_suite_run_share_dir, get_suite_run_work_dir, + get_suite_test_log_name, make_suite_run_tree, ) from cylc.flow.profiler import Profiler @@ -217,7 +218,6 @@ def __init__(self, is_restart, options, args): self.broadcast_mgr = BroadcastMgr(self.suite_db_mgr) self.xtrigger_mgr = None # type: XtriggerManager - self.ref_test_allowed_failures = [] # Last 10 durations (in seconds) of the main loop self.main_loop_intervals = deque(maxlen=10) @@ -417,9 +417,12 @@ 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.genref or self.options.reftest: - self.configure_reftest() - + if self.options.genref: + LOG.addHandler(ReferenceLogFileHandler( + self.config.get_ref_log_name())) + elif self.options.reftest: + LOG.addHandler(ReferenceLogFileHandler( + get_suite_test_log_name(self.suite))) log_extra = {TimestampRotatingFileHandler.FILE_HEADER_FLAG: True} log_extra_num = { TimestampRotatingFileHandler.FILE_HEADER_FLAG: True, @@ -455,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) @@ -464,8 +469,14 @@ def configure(self): self.already_timed_out = False self.set_suite_timer() + # Inactivity setting self.already_inactive = False - if self._get_events_conf(self.EVENT_INACTIVITY_TIMEOUT): + key = self.EVENT_INACTIVITY_TIMEOUT + if self.options.reftest: + self.config.cfg['cylc']['events'][f'abort on {key}'] = True + if not self.config.cfg['cylc']['events'][key]: + self.config.cfg['cylc']['events'][key] = DurationFloat(180) + if self._get_events_conf(key): self.set_suite_inactivity_timer() self.profiler.log_memory("scheduler.py: end configure") @@ -527,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.""" @@ -844,9 +853,6 @@ def command_reload_suite(self): add = set(self.config.get_task_name_list()) - old_tasks for task in add: LOG.warning("Added task: '%s'" % (task,)) - - if self.options.genref or self.options.reftest: - self.configure_reftest(recon=True) self.suite_db_mgr.put_suite_template_vars(self.template_vars) self.suite_db_mgr.put_runtime_inheritance(self.config) self.suite_db_mgr.put_suite_params(self) @@ -1052,47 +1058,6 @@ def _load_template_vars(self, _, row): if key not in self.template_vars: self.template_vars[key] = value - def configure_reftest(self, recon=False): - """Configure the reference test.""" - if self.options.genref: - self.config.cfg['cylc']['log resolved dependencies'] = True - reference_log = os.path.join(self.config.fdir, 'reference.log') - LOG.addHandler(ReferenceLogFileHandler(reference_log)) - elif self.options.reftest: - rtc = self.config.cfg['cylc']['reference test'] - req = rtc['required run mode'] - if req and not self.config.run_mode(req): - raise SchedulerError( - 'suite allows only %s reference tests' % req) - handlers = self._get_events_conf('shutdown handler') - if handlers: - LOG.warning('shutdown handlers replaced by reference test') - self.config.cfg['cylc']['events']['shutdown handler'] = [ - rtc['suite shutdown event handler']] - self.config.cfg['cylc']['log resolved dependencies'] = True - self.config.cfg['cylc']['events'][ - 'abort if shutdown handler fails'] = True - if not recon: - spec = LogSpec(os.path.join(self.config.fdir, 'reference.log')) - self.config.initial_point = get_point( - spec.get_initial_point_string()) - self.config.start_point = get_point( - spec.get_start_point_string()) or self.config.initial_point - self.config.final_point = get_point( - spec.get_final_point_string()) - self.ref_test_allowed_failures = rtc['expected task failures'] - if (not rtc['allow task failures'] and - not self.ref_test_allowed_failures): - self.config.cfg['cylc']['abort if any task fails'] = True - self.config.cfg['cylc']['events']['abort on timeout'] = True - timeout = rtc[self.config.run_mode() + ' mode suite timeout'] - if not timeout: - raise SchedulerError( - 'timeout not defined for %s reference tests' % ( - self.config.run_mode())) - self.config.cfg['cylc']['events'][self.EVENT_TIMEOUT] = ( - timeout) - def run_event_handlers(self, event, reason): """Run a suite event handler. @@ -1107,17 +1072,9 @@ def run_event_handlers(self, event, reason): return except KeyError: pass - try: - self.suite_event_handler.handle(self.config, SuiteEventContext( - event, str(reason), self.suite, self.uuid_str, self.owner, - self.host, self.server.port)) - except SuiteEventError: - if event == self.EVENT_SHUTDOWN and self.options.reftest: - LOG.error('SUITE REFERENCE TEST FAILED') - raise - else: - if event == self.EVENT_SHUTDOWN and self.options.reftest: - LOG.info('SUITE REFERENCE TEST PASSED') + self.suite_event_handler.handle(conf, SuiteEventContext( + event, str(reason), self.suite, self.uuid_str, self.owner, + self.host, self.server.port)) def initialise_scheduler(self): """Prelude to the main scheduler loop. @@ -1161,12 +1118,12 @@ def process_task_pool(self): itasks = self.pool.get_ready_tasks() if itasks: self.is_updated = True - done_tasks = self.task_job_mgr.submit_task_jobs( - self.suite, itasks, self.config.run_mode('simulation')) - if self.config.cfg['cylc']['log resolved dependencies']: - for itask in done_tasks: - deps = itask.state.get_resolved_dependencies() - LOG.info('[%s] -triggered off %s', itask, deps) + for itask in self.task_job_mgr.submit_task_jobs( + self.suite, itasks, self.config.run_mode('simulation') + ): + LOG.info( + '[%s] -triggered off %s', + itask, itask.state.get_resolved_dependencies()) for meth in [ self.pool.spawn_all_tasks, self.pool.remove_spent_tasks, @@ -1218,21 +1175,8 @@ def timeout_check(self): def suite_shutdown(self): """Determines if the suite can be shutdown yet.""" - if (self.config.cfg['cylc']['abort if any task fails'] and - self.pool.any_task_failed()): - # Task failure + abort if any task fails + if self.pool.check_abort_on_task_fails(): self._set_stop(StopMode.AUTO_ON_TASK_FAILURE) - elif self.options.reftest and self.ref_test_allowed_failures: - # In reference test mode and unexpected failures occurred - bad_tasks = [] - for itask in self.pool.get_failed_tasks(): - if itask.identity not in self.ref_test_allowed_failures: - bad_tasks.append(itask) - if bad_tasks: - LOG.error( - 'Failed task(s) not in allowed failures list:\n%s', - '\n'.join('\t%s' % itask.identity for itask in bad_tasks)) - self._set_stop(StopMode.AUTO_ON_TASK_FAILURE) # Can suite shut down automatically? if self.stop_mode is None and ( diff --git a/cylc/flow/suite_events.py b/cylc/flow/suite_events.py index ba43e13c534..dbb31fcdcc5 100644 --- a/cylc/flow/suite_events.py +++ b/cylc/flow/suite_events.py @@ -25,6 +25,7 @@ from cylc.flow.cfgspec.glbl_cfg import glbl_cfg from cylc.flow.exceptions import SuiteEventError from cylc.flow.hostuserutil import get_host, get_user +from cylc.flow.log_diagnosis import run_reftest from cylc.flow.subprocctx import SubProcContext @@ -33,7 +34,7 @@ ["event", "reason", "suite", "uuid_str", "owner", "host", "port"]) -class SuiteEventHandler(object): +class SuiteEventHandler(): """Suite event handler.""" EVENT_STARTUP = 'startup' @@ -68,6 +69,8 @@ def handle(self, config, ctx): """Handle a suite event.""" self._run_event_mail(config, ctx) self._run_event_custom_handlers(config, ctx) + if config.options.reftest and ctx.event == self.EVENT_SHUTDOWN: + run_reftest(config, ctx) def _run_event_mail(self, config, ctx): """Helper for "run_event_handlers", do mail notification.""" diff --git a/cylc/flow/task_events_mgr.py b/cylc/flow/task_events_mgr.py index ca1da06426b..2854c668f84 100644 --- a/cylc/flow/task_events_mgr.py +++ b/cylc/flow/task_events_mgr.py @@ -99,7 +99,7 @@ def log_task_job_activity(ctx, suite, point, name, submit_num=None): LOG.debug(ctx_str) -class TaskEventsManager(object): +class TaskEventsManager(): """Task events manager. This class does the following: @@ -123,6 +123,7 @@ class TaskEventsManager(object): FLAG_RECEIVED = "(received)" FLAG_RECEIVED_IGNORED = "(received-ignored)" FLAG_POLLED = "(polled)" + FLAG_POLLED_IGNORED = "(polled-ignored)" KEY_EXECUTE_TIME_LIMIT = 'execution_time_limit' LEVELS = { "INFO": INFO, @@ -341,16 +342,9 @@ def process_message( event_time = get_current_time_string() if submit_num is None: submit_num = itask.submit_num - logfmt = r'[%s] status=%s: %s%s at %s for job(%02d)' - if flag == self.FLAG_RECEIVED and submit_num != itask.submit_num: - LOG.warning( - logfmt + r' != current job(%02d)', - itask, itask.state, self.FLAG_RECEIVED_IGNORED, message, - event_time, submit_num, itask.submit_num) - return - LOG.log( - self.LEVELS.get(severity, INFO), - logfmt, itask, itask.state, flag, message, event_time, submit_num) + if not self._process_message_check( + itask, severity, message, event_time, flag, submit_num): + return None # always update the suite state summary for latest message if flag == self.FLAG_POLLED: @@ -456,6 +450,44 @@ def process_message( itask.non_unique_events.setdefault(lseverity, 0) itask.non_unique_events[lseverity] += 1 self.setup_event_handlers(itask, lseverity, message) + return None + + def _process_message_check( + self, + itask, + severity, + message, + event_time, + flag, + submit_num, + ): + """Helper for `.process_message`. + + See `.process_message` for argument list + Check whether to process/skip message. + Return True if `.process_message` should contine, False otherwise. + """ + logfmt = r'[%s] status=%s: %s%s at %s for job(%02d)' + if flag == self.FLAG_RECEIVED and submit_num != itask.submit_num: + # Ignore received messages from old jobs + LOG.warning( + logfmt + r' != current job(%02d)', + itask, itask.state, self.FLAG_RECEIVED_IGNORED, message, + event_time, submit_num, itask.submit_num) + return False + if itask.state.status in ( + TASK_STATUS_SUBMIT_RETRYING, TASK_STATUS_RETRYING + ): + # Ignore polled messages if task is already in retrying statuses + LOG.warning( + logfmt, + itask, itask.state, self.FLAG_POLLED_IGNORED, message, + event_time, submit_num) + return False + LOG.log( + self.LEVELS.get(severity, INFO), + logfmt, itask, itask.state, flag, message, event_time, submit_num) + return True def setup_event_handlers(self, itask, event, message): """Set up handlers for a task event.""" diff --git a/cylc/flow/task_pool.py b/cylc/flow/task_pool.py index 5f203ab9b5f..aecfaf6a06c 100644 --- a/cylc/flow/task_pool.py +++ b/cylc/flow/task_pool.py @@ -48,7 +48,7 @@ from cylc.flow.task_job_logs import get_task_job_id from cylc.flow.task_proxy import TaskProxy from cylc.flow.task_state import ( - TASK_STATUSES_ACTIVE, TASK_STATUSES_NOT_STALLED, + TASK_STATUSES_ACTIVE, TASK_STATUSES_FAILURE, TASK_STATUSES_NOT_STALLED, TASK_STATUS_WAITING, TASK_STATUS_EXPIRED, TASK_STATUS_QUEUED, TASK_STATUS_READY, TASK_STATUS_SUBMITTED, TASK_STATUS_SUBMIT_FAILED, TASK_STATUS_SUBMIT_RETRYING, @@ -381,10 +381,7 @@ def load_db_task_pool_for_restart(self, row_idx, row): if timeout is not None: itask.timeout = timeout - elif status in ( - TASK_STATUS_SUBMIT_FAILED, - TASK_STATUS_FAILED - ): + elif status in TASK_STATUSES_FAILURE: itask.state.set_prerequisites_all_satisfied() elif status in ( @@ -724,6 +721,18 @@ def set_do_reload(self, config): self.max_num_active_cycle_points = ( self.config.get_max_num_active_cycle_points()) + # find any old tasks that have been removed from the suite + old_task_name_list = self.task_name_list + self.task_name_list = self.config.get_task_name_list() + for name in old_task_name_list: + if name not in self.task_name_list: + self.orphans.append(name) + for name in self.task_name_list: + if name in self.orphans: + self.orphans.remove(name) + # adjust the new suite config to handle the orphans + self.config.adopt_orphans(self.orphans) + # reassign live tasks from the old queues to the new. # self.queues[queue][id_] = task self.assign_queues() @@ -737,26 +746,15 @@ def set_do_reload(self, config): new_queues[key][id_] = itask self.queues = new_queues - # find any old tasks that have been removed from the suite - old_task_name_list = self.task_name_list - self.task_name_list = self.config.get_task_name_list() - for name in old_task_name_list: - if name not in self.task_name_list: - self.orphans.append(name) - for name in self.task_name_list: - if name in self.orphans: - self.orphans.remove(name) - # adjust the new suite config to handle the orphans - self.config.adopt_orphans(self.orphans) - def reload_taskdefs(self): """Reload task definitions.""" LOG.info("Reloading task definitions.") + tasks = self.get_all_tasks() # Log tasks orphaned by a reload that were not in the task pool. - for task in self.orphans: - if task not in (tsk.tdef.name for tsk in self.get_all_tasks()): - LOG.warning("Removed task: '%s'" % (task,)) - for itask in self.get_all_tasks(): + for name in self.orphans: + if name not in (itask.tdef.name for itask in tasks): + LOG.warning("Removed task: '%s'", name) + for itask in tasks: if itask.tdef.name in self.orphans: if ( itask.state( @@ -962,26 +960,22 @@ def release_all_tasks(self): self.is_held = False self.release_tasks(None) - def get_failed_tasks(self): - """Return failed and submission failed tasks.""" - failed = [] - for itask in self.get_tasks(): - if itask.state( - TASK_STATUS_FAILED, - TASK_STATUS_SUBMIT_FAILED, - ): - failed.append(itask) - return failed + def check_abort_on_task_fails(self): + """Check whether suite should abort on task failure. - def any_task_failed(self): - """Return True if any tasks in the pool failed.""" - for itask in self.get_tasks(): - if itask.state( - TASK_STATUS_FAILED, - TASK_STATUS_SUBMIT_FAILED, - ): - return True - return False + Return True if: + * There are failed tasks and `abort if any task fails` is specified. + * There are unexpected failed tasks in a reference test. + """ + expected_failed_tasks = self.config.get_expected_failed_tasks() + if expected_failed_tasks is None: + return False + return any( + ( + itask.state.status in TASK_STATUSES_FAILURE + and itask.identity not in expected_failed_tasks + ) + for itask in self.get_tasks()) def match_dependencies(self): """Run time dependency negotiation. @@ -1333,7 +1327,7 @@ def get_task_requisites(self, items, list_prereqs=False): extras = {} if itask.tdef.clocktrigger_offset is not None: extras['Clock trigger time reached'] = ( - not itask.is_waiting_clock(now)) + itask.is_waiting_clock_done(now)) extras['Triggers at'] = get_time_string_from_unix_time( itask.clock_trigger_time) for trig, satisfied in itask.state.external_triggers.items(): diff --git a/cylc/flow/task_proxy.py b/cylc/flow/task_proxy.py index 38b1a54ebbe..f8aa12e8f0a 100644 --- a/cylc/flow/task_proxy.py +++ b/cylc/flow/task_proxy.py @@ -285,6 +285,7 @@ def copy_to_reload_successor(self, reload_successor): reload_successor.poll_timer = self.poll_timer reload_successor.timeout = self.timeout reload_successor.state.outputs = self.state.outputs + reload_successor.state.is_held = self.state.is_held reload_successor.state.is_updated = self.state.is_updated @staticmethod @@ -370,15 +371,14 @@ def is_ready(self, now): """ if self.manual_trigger: return True - waiting_retry = self.is_waiting_retry(now) - if waiting_retry is not None: - return not waiting_retry - if not self.state( - TASK_STATUS_WAITING, - is_held=False - ): + if self.state.is_held: return False - return not (self.is_waiting_clock(now) or self.is_waiting_prereqs()) + if self.state.status in self.try_timers: + return self.try_timers[self.state.status].is_delay_done(now) + return ( + self.state(TASK_STATUS_WAITING) + and self.is_waiting_clock_done(now) + and self.is_waiting_prereqs_done()) def reset_manual_trigger(self): """This is called immediately after manual trigger flag used.""" @@ -409,31 +409,23 @@ def set_summary_time(self, event_key, time_str=None): self.summary[event_key + '_time'] = float(str2time(time_str)) self.summary[event_key + '_time_string'] = time_str - def is_waiting_clock(self, now): - """Is this task waiting for its clock trigger time?""" + def is_waiting_clock_done(self, now): + """Is this task done waiting for its clock trigger time? + + Return True if there is no clock trigger or when clock trigger is done. + """ if self.tdef.clocktrigger_offset is None: - return None + return True if self.clock_trigger_time is None: self.clock_trigger_time = ( self.get_point_as_seconds() + self.get_offset_as_seconds(self.tdef.clocktrigger_offset)) - return self.clock_trigger_time > now + return now >= self.clock_trigger_time - def is_waiting_prereqs(self): + def is_waiting_prereqs_done(self): """Is this task waiting for its prerequisites?""" return ( - any(not pre.is_satisfied() for pre in self.state.prerequisites) - or any(not tri for tri in self.state.external_triggers.values()) - or not self.state.xtriggers_all_satisfied() + all(pre.is_satisfied() for pre in self.state.prerequisites) + and all(tri for tri in self.state.external_triggers.values()) + and self.state.xtriggers_all_satisfied() ) - - def is_waiting_retry(self, now): - """Is this task waiting for its latest (submission) retry delay time? - - Return True if waiting for next retry delay time, False if not. - Return None if no retry lined up. - """ - try: - return not self.try_timers[self.state.status].is_delay_done(now) - except KeyError: - return None diff --git a/cylc/flow/tests/test_pathutil.py b/cylc/flow/tests/test_pathutil.py index 6a5f1c53457..e665abc5de8 100644 --- a/cylc/flow/tests/test_pathutil.py +++ b/cylc/flow/tests/test_pathutil.py @@ -32,6 +32,7 @@ get_suite_run_rc_dir, get_suite_run_share_dir, get_suite_run_work_dir, + get_suite_test_log_name, make_suite_run_tree, ) @@ -109,6 +110,8 @@ def test_get_suite_run_names(self, mocked_glbl_cfg): for func, cfg, tail1 in ( (get_suite_run_log_name, 'run directory', '/log/suite/log'), (get_suite_run_pub_db_name, 'run directory', '/log/db'), + (get_suite_test_log_name, 'run directory', + '/log/suite/reftest.log'), ): self.assertEqual( f'/home/sweet/cylc-run/my-suite/dream{tail1}', diff --git a/flakytests/cylc-get-config/04-dummy-mode-output/suite.rc b/flakytests/cylc-get-config/04-dummy-mode-output/suite.rc index 5d51f526b57..96271187648 100644 --- a/flakytests/cylc-get-config/04-dummy-mode-output/suite.rc +++ b/flakytests/cylc-get-config/04-dummy-mode-output/suite.rc @@ -5,6 +5,8 @@ UTC mode = True [[events]] abort on stalled = True + abort on inactivity = True + inactivity = PT3M [scheduling] initial cycle point = 2000 final cycle point = 2000 diff --git a/tests/cylc-kill/02-submitted.t b/flakytests/cylc-kill/02-submitted.t similarity index 100% rename from tests/cylc-kill/02-submitted.t rename to flakytests/cylc-kill/02-submitted.t diff --git a/tests/cylc-kill/02-submitted/reference.log b/flakytests/cylc-kill/02-submitted/reference.log similarity index 100% rename from tests/cylc-kill/02-submitted/reference.log rename to flakytests/cylc-kill/02-submitted/reference.log diff --git a/tests/cylc-kill/02-submitted/suite.rc b/flakytests/cylc-kill/02-submitted/suite.rc similarity index 90% rename from tests/cylc-kill/02-submitted/suite.rc rename to flakytests/cylc-kill/02-submitted/suite.rc index b12cfa7ad90..d2158738a69 100644 --- a/tests/cylc-kill/02-submitted/suite.rc +++ b/flakytests/cylc-kill/02-submitted/suite.rc @@ -2,8 +2,6 @@ [cylc] UTC mode = True [[reference test]] - required run mode = live - live mode suite timeout = PT1M expected task failures = killable-1.1, killable-2.1, killable-3.1 [scheduling] [[graph]] diff --git a/flakytests/cylc-kill/test_header b/flakytests/cylc-kill/test_header new file mode 120000 index 00000000000..90bd5a36f92 --- /dev/null +++ b/flakytests/cylc-kill/test_header @@ -0,0 +1 @@ +../lib/bash/test_header \ No newline at end of file diff --git a/flakytests/cylc-poll/03-poll-all/suite.rc b/flakytests/cylc-poll/03-poll-all/suite.rc index ac39f4f74ab..2a9c452fc2a 100644 --- a/flakytests/cylc-poll/03-poll-all/suite.rc +++ b/flakytests/cylc-poll/03-poll-all/suite.rc @@ -14,8 +14,6 @@ trigger, and the suite to shut down successfully.""" abort on inactivity = True inactivity = PT2M [[reference test]] - required run mode = live - live mode suite timeout = PT2M # minutes expected task failures = run_kill.20141207T0000Z,\ run_kill.20141208T0000Z,\ submit_hold.20141207T0000Z,\ diff --git a/flakytests/cylc-poll/16-execution-time-limit/suite.rc b/flakytests/cylc-poll/16-execution-time-limit/suite.rc index 88716ecb8ea..80b2935d32a 100644 --- a/flakytests/cylc-poll/16-execution-time-limit/suite.rc +++ b/flakytests/cylc-poll/16-execution-time-limit/suite.rc @@ -1,6 +1,6 @@ [cylc] [[events]] - timeout = PT1M + abort on stalled = True [[reference test]] expected task failures = foo.1 [scheduling] diff --git a/flakytests/cylc-reset/02-output-1/suite.rc b/flakytests/cylc-reset/02-output-1/suite.rc index cdfd48830f4..b795eb7b44d 100644 --- a/flakytests/cylc-reset/02-output-1/suite.rc +++ b/flakytests/cylc-reset/02-output-1/suite.rc @@ -2,9 +2,6 @@ UTC mode = True [[events]] abort on stalled = True - [[reference test]] - live mode suite timeout = PT1M - required run mode = live [scheduling] [[graph]] R1 = """ diff --git a/flakytests/cylc-show/00-simple/reference.log b/flakytests/cylc-show/00-simple/reference.log index faed584a197..a0300429174 100644 --- a/flakytests/cylc-show/00-simple/reference.log +++ b/flakytests/cylc-show/00-simple/reference.log @@ -8,3 +8,4 @@ 2017-12-12T17:43:38Z INFO - [show-taskinstance.20141106T0900Z] -triggered off ['foo.20141106T0900Z'] 2017-12-12T17:43:38Z INFO - [show-task.20141106T0900Z] -triggered off ['foo.20141106T0900Z'] 2017-12-12T17:43:38Z INFO - [show-suite.20141106T0900Z] -triggered off ['foo.20141106T0900Z'] +2017-12-12T17:43:38Z INFO - [end.20141106T0900Z] -triggered off ['show-suite-json.20141106T0900Z', 'show-suite.20141106T0900Z', 'show-task-json.20141106T0900Z', 'show-task.20141106T0900Z', 'show-taskinstance-json.20141106T0900Z', 'show-taskinstance.20141106T0900Z'] diff --git a/flakytests/cylc-show/00-simple/suite.rc b/flakytests/cylc-show/00-simple/suite.rc index c2542d1a2a0..83bcce65d3d 100644 --- a/flakytests/cylc-show/00-simple/suite.rc +++ b/flakytests/cylc-show/00-simple/suite.rc @@ -2,7 +2,7 @@ [meta] title = a test suite description = the quick brown fox - custom = custard + custom = custard [cylc] UTC mode = True [scheduling] @@ -11,31 +11,45 @@ [[graph]] PT1H = """ bar => foo - foo:start => show-suite & show-task & show-taskinstance & \ - show-suite-json & show-task-json & show-taskinstance-json + foo:start => SHOW + SHOW:finish-all => end """ [runtime] [[foo]] - script = sleep 10 + script = """ +touch 'foot' +while [[ -e 'foot' ]]; do + sleep 1 +done +""" [[[meta]]] title = a task description = jumped over the lazy dog baz = pub - [[bar,baz]] + [[bar]] script = true + [[end]] + script = rm -f '../foo/foot' + [[SHOW]] [[show-suite]] + inherit = SHOW script = cylc show "$CYLC_SUITE_NAME" >>{{ TEST_OUTPUT_PATH }}-suite [[show-task]] + inherit = SHOW script = cylc show "$CYLC_SUITE_NAME" foo >>{{ TEST_OUTPUT_PATH }}-task [[show-taskinstance]] + inherit = SHOW script = cylc show "$CYLC_SUITE_NAME" foo.20141106T0900Z \ >>{{ TEST_OUTPUT_PATH }}-taskinstance [[show-suite-json]] + inherit = SHOW script = cylc show --json "$CYLC_SUITE_NAME" \ >>{{ TEST_OUTPUT_PATH }}-json-suite [[show-task-json]] + inherit = SHOW script = cylc show --json "$CYLC_SUITE_NAME" foo \ >>{{ TEST_OUTPUT_PATH }}-json-task [[show-taskinstance-json]] + inherit = SHOW script = cylc show --json "$CYLC_SUITE_NAME" foo.20141106T0900Z \ >>{{ TEST_OUTPUT_PATH }}-json-taskinstance diff --git a/flakytests/cylc-take-checkpoints/00-basic.t b/flakytests/cylc-take-checkpoints/00-basic.t index 60e48cbf5ab..5f47ccb8cc4 100755 --- a/flakytests/cylc-take-checkpoints/00-basic.t +++ b/flakytests/cylc-take-checkpoints/00-basic.t @@ -30,7 +30,7 @@ run_ok "${TEST_NAME_BASE}-validate" cylc validate "${SUITE_NAME}" # Suite reloads+inserts new task to mess up prerequisites - suite should stall suite_run_ok "${TEST_NAME_BASE}-run" \ - timeout 120 cylc run --debug --no-detach --reference-test "${SUITE_NAME}" + cylc run --debug --no-detach --reference-test "${SUITE_NAME}" cylc ls-checkpoints "${SUITE_NAME}" | date-remove >'cylc-ls-checkpoints.out' contains_ok 'cylc-ls-checkpoints.out' <<'__OUT__' ####################################################################### diff --git a/flakytests/database/01-broadcast/suite.rc b/flakytests/database/01-broadcast/suite.rc index b8ca79e7f6e..1cbcd96a0e6 100644 --- a/flakytests/database/01-broadcast/suite.rc +++ b/flakytests/database/01-broadcast/suite.rc @@ -1,6 +1,3 @@ -[cylc] - [[reference test]] - live mode suite timeout = PT1M [scheduling] [[graph]] R1 = """ diff --git a/flakytests/database/02-retry/suite.rc b/flakytests/database/02-retry/suite.rc index daa9fc03c8d..47ff5677ee1 100644 --- a/flakytests/database/02-retry/suite.rc +++ b/flakytests/database/02-retry/suite.rc @@ -1,8 +1,5 @@ [cylc] UTC mode=True - [[reference test]] - allow task failures = True - live mode suite timeout = PT1M [scheduling] initial cycle point=2020 final cycle point=2020 diff --git a/flakytests/events/01-task.t b/flakytests/events/01-task.t index 7e071365567..183823bbea3 100755 --- a/flakytests/events/01-task.t +++ b/flakytests/events/01-task.t @@ -18,13 +18,17 @@ # Validate and run the task events suite. . "$(dirname "$0")/test_header" #------------------------------------------------------------------------------- -set_test_number 2 +set_test_number 3 #------------------------------------------------------------------------------- install_suite "${TEST_NAME_BASE}" "${TEST_NAME_BASE}" #------------------------------------------------------------------------------- run_ok "${TEST_NAME_BASE}-validate" cylc validate "${SUITE_NAME}" suite_run_ok "${TEST_NAME_BASE}-run" \ cylc run --reference-test --debug --no-detach "${SUITE_NAME}" +sort -u 'events.log' >'expected.events.log' +sed 's/ (after .*)$//' "${SUITE_RUN_DIR}/log/suite/events.log" | sort -u \ + >'actual.events.log' +cmp_ok 'actual.events.log' 'expected.events.log' #------------------------------------------------------------------------------- purge_suite "${SUITE_NAME}" exit diff --git a/flakytests/events/01-task/bin/log-check.sh b/flakytests/events/01-task/bin/log-check.sh deleted file mode 100755 index 78b3153de65..00000000000 --- a/flakytests/events/01-task/bin/log-check.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash -set -eu - -echo "HELLO FROM log-check.sh shutdown handler for ${CYLC_SUITE_NAME}" - -# compare events.log with the reference version -# sorted so that event order doesn't matter - -sed -i 's/ (after .\+)$//' "${EVNTLOG}" -REF_LOG="${CYLC_SUITE_DEF_PATH}/events.log" - -# difference with 'sort -u' (unique) because polling on timeouts may now -# result in multiple 'started' messages etc. -if ! diff -u <(sort -u "${EVNTLOG}") <(sort -u "${REF_LOG}") >&2; then - echo 'ERROR: event handler output logs differ' >&2 - exit 1 -else - echo 'OK: event handler output logs agree' -fi - -echo "BYE FROM log-check.sh shutdown handler for ${CYLC_SUITE_NAME}" diff --git a/flakytests/events/01-task/events.log b/flakytests/events/01-task/events.log index d67ab9f6b86..587096a2aed 100644 --- a/flakytests/events/01-task/events.log +++ b/flakytests/events/01-task/events.log @@ -1,12 +1,12 @@ EVENT TASK MESSAGE +critical foo.1 failed/EXIT +execution timeout foo.1 execution timeout after PT3S +failed baz.1 job failed retry foo.1 job failed, retrying in PT3S +started baz.1 job started +submission failed bar.1 job submission failed submission retry bar.1 job submission failed, submit-retrying in PT3S -submitted baz.1 job submitted submission timeout baz.1 submission timeout after PT3S -submission failed bar.1 job submission failed -execution timeout foo.1 execution timeout after PT3S -started baz.1 job started -failed baz.1 job failed -warning foo.1 this is a user-defined warning message -critical foo.1 failed/EXIT +submitted baz.1 job submitted succeeded foo.1 job succeeded +warning foo.1 this is a user-defined warning message diff --git a/flakytests/events/01-task/reference.log b/flakytests/events/01-task/reference.log index 86d02d2de73..f3c1c3f7bce 100644 --- a/flakytests/events/01-task/reference.log +++ b/flakytests/events/01-task/reference.log @@ -6,4 +6,4 @@ 2013/05/20 22:05:00 INFO - [baz.1] -triggered off ['prep.1'] 2013/05/20 22:05:03 INFO - [foo.1] -triggered off ['prep.1'] 2013/05/20 22:05:03 INFO - [bar.1] -triggered off ['prep.1'] -2013/05/20 22:05:07 INFO - [done.1] -triggered off ['bar.1', 'baz.1'] +2013/05/20 22:05:07 INFO - [done.1] -triggered off ['bar.1', 'baz.1', 'foo.1'] diff --git a/flakytests/events/01-task/suite.rc b/flakytests/events/01-task/suite.rc index 77ee93e5c33..d0be664099e 100644 --- a/flakytests/events/01-task/suite.rc +++ b/flakytests/events/01-task/suite.rc @@ -9,18 +9,20 @@ [cylc] [[environment]] EVNTLOG = {{ EVNTLOG }} + [[events]] + abort on stalled = True + abort on inactivity = True + inactivity = PT3M [[reference test]] - live mode suite timeout = PT1M - suite shutdown event handler = log-check.sh expected task failures = bar.1, baz.1 [scheduling] [[graph]] R1 = """ - prep => foo & bar & baz - bar:submit-fail & baz:fail & foo => done - done => !bar & !baz - """ + prep => foo & bar & baz + bar:submit-fail & baz:fail & foo => done + done => !bar & !baz + """ [runtime] [[root]] # make the event handler log available to gcylc: @@ -28,17 +30,17 @@ script = "true" # fast [[prep]] - script = """ -printf "%-20s %-8s %s\n" EVENT TASK MESSAGE > {{ EVNTLOG }} - """ + script = printf "%-20s %-8s %s\n" EVENT TASK MESSAGE > {{ EVNTLOG }} [[foo]] # timeout, retry, warning, succeeded script = """ -if [[ $CYLC_TASK_TRY_NUMBER == 1 ]]; then - false -else - sleep 10; cylc task message -p WARNING 'this is a user-defined warning message' -fi""" +test "${CYLC_TASK_TRY_NUMBER}" -gt 1 +while ! grep -q 'execution timeout *foo\.1' "${CYLC_SUITE_LOG_DIR}/events.log" +do + sleep 1 +done +cylc task message -p WARNING 'this is a user-defined warning message' +""" [[[job]]] execution retry delays = PT3S [[[events]]] @@ -61,7 +63,12 @@ fi""" [[baz]] # submitted, submission timeout, started, failed - init-script = sleep 15 + init-script = """ +while ! grep -q 'submission timeout *baz\.1' "${CYLC_SUITE_LOG_DIR}/events.log" +do + sleep 1 +done +""" script = false [[[events]]] submitted handler = {{ HANDLER }} diff --git a/flakytests/events/05-timeout-ref-dummy.t b/flakytests/events/05-timeout-ref-dummy.t index a5621ba66eb..80909e609e8 100755 --- a/flakytests/events/05-timeout-ref-dummy.t +++ b/flakytests/events/05-timeout-ref-dummy.t @@ -29,7 +29,7 @@ RUN_MODE="$(basename "$0" | sed "s/.*-ref-\(.*\).t/\1/g")" suite_run_fail "${TEST_NAME}" \ cylc run --reference-test --mode="${RUN_MODE}" --debug --no-detach \ "${SUITE_NAME}" -grep_ok "WARNING - suite timed out after PT6S" "${TEST_NAME}.stderr" +grep_ok "WARNING - suite timed out after PT1S" "${TEST_NAME}.stderr" #------------------------------------------------------------------------------- purge_suite "${SUITE_NAME}" exit diff --git a/flakytests/events/05-timeout-ref-dummy/suite.rc b/flakytests/events/05-timeout-ref-dummy/suite.rc index 7a71f8cd031..b969f1f3400 100644 --- a/flakytests/events/05-timeout-ref-dummy/suite.rc +++ b/flakytests/events/05-timeout-ref-dummy/suite.rc @@ -2,10 +2,9 @@ description = This suite is supposed to time out [cylc] - [[reference test]] - live mode suite timeout = PT0.5M - dummy mode suite timeout = PT6S - simulation mode suite timeout = PT12S + [[events]] + abort on timeout = True + timeout = PT1S [scheduling] [[graph]] diff --git a/flakytests/events/39-task-event-template-all.t b/flakytests/events/39-task-event-template-all.t index 15dd4e29b09..3a92e3d3fd1 100755 --- a/flakytests/events/39-task-event-template-all.t +++ b/flakytests/events/39-task-event-template-all.t @@ -23,7 +23,8 @@ install_suite "${TEST_NAME_BASE}" "${TEST_NAME_BASE}" run_ok "${TEST_NAME_BASE}-validate" cylc validate "${SUITE_NAME}" -suite_run_ok "${TEST_NAME_BASE}-run" cylc run --debug --no-detach "${SUITE_NAME}" +suite_run_ok "${TEST_NAME_BASE}-run" \ + cylc run --debug --no-detach --reference-test "${SUITE_NAME}" FOO_ACTIVITY_LOG="${SUITE_RUN_DIR}/log/job/1/foo/NN/job-activity.log" grep_ok 'OK: command line checks out' "${FOO_ACTIVITY_LOG}" diff --git a/flakytests/events/39-task-event-template-all/reference.log b/flakytests/events/39-task-event-template-all/reference.log new file mode 100644 index 00000000000..6d6f9e23729 --- /dev/null +++ b/flakytests/events/39-task-event-template-all/reference.log @@ -0,0 +1,3 @@ +Initial point: 1 +Final point: 1 +[foo.1] -triggered off [] diff --git a/flakytests/events/39-task-event-template-all/suite.rc b/flakytests/events/39-task-event-template-all/suite.rc index d8c8886862e..d8a84bb8297 100644 --- a/flakytests/events/39-task-event-template-all/suite.rc +++ b/flakytests/events/39-task-event-template-all/suite.rc @@ -2,10 +2,6 @@ [meta] title = a test suite size = large -[cylc] - [[events]] - inactivity = PT15S - abort on inactivity = True [scheduling] [[graph]] R1 = "foo" diff --git a/flakytests/execution-time-limit/00-background/suite.rc b/flakytests/execution-time-limit/00-background/suite.rc index fd4323647de..aa07abc495e 100644 --- a/flakytests/execution-time-limit/00-background/suite.rc +++ b/flakytests/execution-time-limit/00-background/suite.rc @@ -1,13 +1,11 @@ #!jinja2 [cylc] - abort if any task fails = True [[events]] + abort if any task fails = True abort on inactivity = True abort on stalled = True inactivity = PT2M [[reference test]] - required run mode = live - live mode suite timeout = PT30S expected task failures = foo.1 [scheduling] diff --git a/flakytests/execution-time-limit/04-poll/suite.rc b/flakytests/execution-time-limit/04-poll/suite.rc index 1709ed6f104..9ef342698ff 100644 --- a/flakytests/execution-time-limit/04-poll/suite.rc +++ b/flakytests/execution-time-limit/04-poll/suite.rc @@ -1,12 +1,9 @@ #!jinja2 [cylc] - abort if any task fails = True [[events]] + abort if any task fails = True abort on inactivity = True inactivity = PT2M - [[reference test]] - required run mode = live - live mode suite timeout = PT2M [scheduling] [[graph]] diff --git a/flakytests/hold-release/14-hold-kill/suite.rc b/flakytests/hold-release/14-hold-kill/suite.rc index 6d218ae4608..9c7a18726a5 100644 --- a/flakytests/hold-release/14-hold-kill/suite.rc +++ b/flakytests/hold-release/14-hold-kill/suite.rc @@ -1,10 +1,6 @@ #!Jinja2 [meta] title = Test: task should be held from retrying after a job kill - -[cylc] - [[reference test]] - live mode suite timeout = PT30S [scheduling] [[graph]] R1 = "sleeper:start => killer" @@ -12,29 +8,29 @@ [[killer]] script = """ echo '# killing "sleeper"' - cylc kill "${CYLC_SUITE_NAME}" "sleeper.${CYLC_TASK_CYCLE_POINT}" - - echo '# waiting for "sleeper" to disappear' - while grep -q '^sleeper, 1, running, spawned, unheld' \ - <<<"$(cylc dump -t "${CYLC_SUITE_NAME}")" + cylc kill "${CYLC_SUITE_NAME}" "sleeper.1" + LOG="${CYLC_SUITE_LOG_DIR}/log" + while ! grep -q -F '[sleeper.1] -running => running (held)' "${LOG}" do - sleep 0.2 # cylc dump can be quite slow + sleep 1 done - - echo '# waiting for "sleeper" to reappear' - while ! grep -q '^sleeper' \ - <<<"$(cylc dump -t "${CYLC_SUITE_NAME}")" + while ! grep -q -F '[sleeper.1] -running (held) => retrying (held)' "${LOG}" do - sleep 0.2 + sleep 1 done - - echo '# testing that "sleeper" is held on re-insertion' - grep -q '^sleeper, 1, retrying, spawned, held' \ - <<<"$(cylc dump -t "${CYLC_SUITE_NAME}")" - - cylc release "${CYLC_SUITE_NAME}" "sleeper.${CYLC_TASK_CYCLE_POINT}" + sleep 10 # sleep should still be held after 10 seconds + cylc dump -s -t "${CYLC_SUITE_NAME}" >'cylc-dump.out' + diff -u 'cylc-dump.out' - <<'__OUT__' + 1, killer, running, spawned, unheld + 1, sleeper, retrying, spawned, held + __OUT__ + cylc release "${CYLC_SUITE_NAME}" "sleeper.1" """ [[sleeper]] - script = test "${CYLC_TASK_TRY_NUMBER}" -gt 1 || sleep 60 + script = """ + if ((CYLC_TASK_TRY_NUMBER == 1)); then + sleep 120 + fi + """ [[[job]]] execution retry delays = PT1S diff --git a/flakytests/hold-release/15-hold-after/suite.rc b/flakytests/hold-release/15-hold-after/suite.rc index 609e0924ce4..726d36e2cc8 100644 --- a/flakytests/hold-release/15-hold-after/suite.rc +++ b/flakytests/hold-release/15-hold-after/suite.rc @@ -6,11 +6,7 @@ [cylc] UTC mode = True [[events]] - abort on inactivity = true - abort on stalled = true - abort on timeout = true - inactivity = PT30S - timeout = PT30S + abort on stalled = True [scheduling] initial cycle point = 20140101T00 diff --git a/flakytests/integer-cycling/00-satellite/suite.rc b/flakytests/integer-cycling/00-satellite/suite.rc index 0fdf0544378..1e80f0b80e8 100644 --- a/flakytests/integer-cycling/00-satellite/suite.rc +++ b/flakytests/integer-cycling/00-satellite/suite.rc @@ -17,11 +17,6 @@ {% set DATA_IN_DIR = "$CYLC_SUITE_SHARE_DIR/incoming" %} {% set PRODUCT_DIR = "$CYLC_SUITE_SHARE_DIR/products" %} -[cylc] - [[reference test]] - required run mode = live - live mode suite timeout = PT1M - [scheduling] cycling mode = integer initial cycle point = 1 diff --git a/flakytests/job-submission/05-activity-log/suite.rc b/flakytests/job-submission/05-activity-log/suite.rc index 78fd4a424fc..87df0277fa4 100644 --- a/flakytests/job-submission/05-activity-log/suite.rc +++ b/flakytests/job-submission/05-activity-log/suite.rc @@ -1,8 +1,6 @@ [cylc] [[reference test]] expected task failures = t1.1 - required run mode = live - live mode suite timeout = PT30S [scheduling] [[graph]] @@ -28,4 +26,4 @@ cylc shutdown "${CYLC_SUITE_NAME}" """ [[[job]]] - execution time limit = PT25S + execution time limit = PT1M diff --git a/flakytests/modes/03-dummy-env/suite.rc b/flakytests/modes/03-dummy-env/suite.rc index f6a63f9ca37..ca90bb8a341 100644 --- a/flakytests/modes/03-dummy-env/suite.rc +++ b/flakytests/modes/03-dummy-env/suite.rc @@ -1,18 +1,16 @@ [cylc] force run mode = dummy-local - [[reference test]] - dummy-local mode suite timeout = PT30S [scheduling] [[graph]] R1 = oxygas [runtime] [[root]] - script = sleep 1 + script = true [[[simulation]]] - default run length = PT1S + default run length = PT0S [[oxygas]] env-script = ELSE=foo [[[remote]]] - host = els055 + host = whatever [[[environment]]] SOMETHING = "some-modification-$ELSE" diff --git a/flakytests/restart/03-retrying.t b/flakytests/restart/03-retrying.t deleted file mode 100755 index e1152965102..00000000000 --- a/flakytests/restart/03-retrying.t +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/bash -# THIS FILE IS PART OF THE CYLC SUITE ENGINE. -# Copyright (C) 2008-2019 NIWA & British Crown (Met Office) & Contributors. -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -#------------------------------------------------------------------------------- -# Test restarting a simple suite with a task in a retrying state. -if [[ -z "${TEST_DIR:-}" ]]; then - . "$(dirname "$0")/test_header" -fi -#------------------------------------------------------------------------------- -set_test_number 7 -#------------------------------------------------------------------------------- -install_suite "${TEST_NAME_BASE}" "${TEST_NAME_BASE}" -cp "${TEST_SOURCE_DIR}/lib/suite-runtime-restart.rc" "${TEST_DIR}/${SUITE_NAME}/" -export TEST_DIR -#------------------------------------------------------------------------------- -TEST_NAME="${TEST_NAME_BASE}-validate" -run_ok "${TEST_NAME}" cylc validate "${SUITE_NAME}" -cmp_ok "${TEST_NAME}.stderr" <'/dev/null' -#------------------------------------------------------------------------------- -TEST_NAME="${TEST_NAME_BASE}-run" -suite_run_ok "${TEST_NAME}" cylc run --debug --no-detach "${SUITE_NAME}" -#------------------------------------------------------------------------------- -TEST_NAME="${TEST_NAME_BASE}-restart-run" -suite_run_ok "${TEST_NAME}" cylc restart --debug --no-detach "${SUITE_NAME}" -#------------------------------------------------------------------------------- -if ! command -v 'sqlite3' >'/dev/null'; then - skip 3 "sqlite3 not installed?" - purge_suite "${SUITE_NAME}" - exit 0 -fi -grep_ok "retrying_task|20130923T0000Z|1|1|retrying" \ - "${TEST_DIR}/pre-restart-db" -contains_ok "${TEST_DIR}/post-restart-db" <<'__DB_DUMP__' -finish|20130923T0000Z|0||waiting -retrying_task|20130923T0000Z|1|1|retrying -shutdown|20130923T0000Z|1|1|succeeded -__DB_DUMP__ -"${TEST_SOURCE_DIR}/bin/ctb-select-task-states" "${SUITE_RUN_DIR}" \ - > "${TEST_DIR}/db" -contains_ok "${TEST_DIR}/db" <<'__DB_DUMP__' -finish|20130923T0000Z|1|1|succeeded -output_states|20130923T0000Z|1|1|succeeded -retrying_task|20130923T0000Z|3|3|succeeded -shutdown|20130923T0000Z|1|1|succeeded -__DB_DUMP__ -#------------------------------------------------------------------------------- -purge_suite "${SUITE_NAME}" -exit diff --git a/flakytests/restart/03-retrying/bin/ctb-select-task-states b/flakytests/restart/03-retrying/bin/ctb-select-task-states deleted file mode 100755 index 3dc474171ea..00000000000 --- a/flakytests/restart/03-retrying/bin/ctb-select-task-states +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash -# THIS FILE IS PART OF THE CYLC SUITE ENGINE. -# Copyright (C) 2008-2019 NIWA & British Crown (Met Office) & Contributors. -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -#------------------------------------------------------------------------------- -set -eu -CYLC_SUITE_RUN_DIR="$1" -CYLC_TASK_NAME="${2:-}" -sqlite3 "${CYLC_SUITE_RUN_DIR}/log/db" " -SELECT - task_states.name, - task_states.cycle, - task_states.submit_num, - task_jobs.try_num, - task_states.status -FROM - task_states -LEFT OUTER JOIN - task_jobs -ON - task_states.name == task_jobs.name -AND - task_states.cycle == task_jobs.cycle -AND - task_states.submit_num == task_jobs.submit_num -WHERE - task_states.name != '${CYLC_TASK_NAME}' -ORDER BY - task_states.name, task_states.cycle -;" diff --git a/flakytests/restart/03-retrying/suite.rc b/flakytests/restart/03-retrying/suite.rc deleted file mode 100644 index a5c6df57f03..00000000000 --- a/flakytests/restart/03-retrying/suite.rc +++ /dev/null @@ -1,38 +0,0 @@ -#!jinja2 -{%- set TEST_DIR = environ['TEST_DIR'] %} -[cylc] - UTC mode = True - [[events]] - abort on inactivity = True - abort on timeout = True - inactivity = PT3M - timeout = PT3M -[scheduling] - initial cycle point = 20130923T00 - final cycle point = 20130923T00 - [[graph]] - R1 = """ - retrying_task:start => shutdown - shutdown => output_states - output_states & retrying_task => finish - """ -[runtime] - [[retrying_task]] - script = """ - wait - sleep 10 - if [[ $CYLC_TASK_TRY_NUMBER -le 2 ]]; then - exit 1 - fi - """ - [[[meta]]] - description = "Retrying state task for restart" - [[[job]]] - execution retry delays = PT40S, PT1S -{% include 'suite-runtime-restart.rc' %} - [[shutdown]] - pre-script = sleep 5 # Extra sleep as trigger from retry task start. - [[output_states]] - pre-script = """ - sleep 10 - """ diff --git a/flakytests/restart/04-running.t b/flakytests/restart/04-running.t deleted file mode 100755 index eee7c0728ec..00000000000 --- a/flakytests/restart/04-running.t +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/bash -# THIS FILE IS PART OF THE CYLC SUITE ENGINE. -# Copyright (C) 2008-2019 NIWA & British Crown (Met Office) & Contributors. -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -#------------------------------------------------------------------------------- -# Test restarting a simple suite with a task still running (orphaned) -if [[ -z "${TEST_DIR:-}" ]]; then - . "$(dirname "$0")/test_header" -fi -#------------------------------------------------------------------------------- -set_test_number 7 -#------------------------------------------------------------------------------- -install_suite "${TEST_NAME_BASE}" "${TEST_NAME_BASE}" -cp "${TEST_SOURCE_DIR}/lib/suite-runtime-restart.rc" "${TEST_DIR}/${SUITE_NAME}/" -export TEST_DIR -#------------------------------------------------------------------------------- -TEST_NAME="${TEST_NAME_BASE}-validate" -run_ok "${TEST_NAME}" cylc validate "${SUITE_NAME}" -cmp_ok "${TEST_NAME}.stderr" '/dev/null'; then - skip 3 "sqlite3 not installed?" - purge_suite "${SUITE_NAME}" - exit 0 -fi -grep_ok "running_task|20130923T0000Z|1|1|running" \ - "${TEST_DIR}/pre-restart-db" -contains_ok "${TEST_DIR}/post-restart-db" <<'__DB_DUMP__' -finish|20130923T0000Z|0||waiting -running_task|20130923T0000Z|1|1|running -shutdown|20130923T0000Z|1|1|succeeded -__DB_DUMP__ -"${TEST_SOURCE_DIR}/bin/ctb-select-task-states" "${SUITE_RUN_DIR}" \ - > "${TEST_DIR}/db" -contains_ok "${TEST_DIR}/db" <<'__DB_DUMP__' -finish|20130923T0000Z|1|1|succeeded -output_states|20130923T0000Z|1|1|succeeded -running_task|20130923T0000Z|1|1|succeeded -shutdown|20130923T0000Z|1|1|succeeded -__DB_DUMP__ -#------------------------------------------------------------------------------- -purge_suite "${SUITE_NAME}" -exit diff --git a/flakytests/restart/04-running/suite.rc b/flakytests/restart/04-running/suite.rc deleted file mode 100644 index 4bd9ac5bd79..00000000000 --- a/flakytests/restart/04-running/suite.rc +++ /dev/null @@ -1,29 +0,0 @@ -#!jinja2 -{%- set TEST_DIR = environ['TEST_DIR'] %} -[cylc] - UTC mode = True - [[events]] - abort on timeout = True - timeout = PT3M -[scheduling] - initial cycle point = 20130923T00 - final cycle point = 20130923T00 - [[graph]] - R1 = """ - running_task:start => shutdown - shutdown => output_states - output_states & running_task => finish - """ -[runtime] - [[running_task]] - script = """ - sleep 50 - """ - [[[meta]]] - description = "Running task (runs during restart)" -{% include 'suite-runtime-restart.rc' %} - [[shutdown]] - post-script = """ - cylc shutdown --now $CYLC_SUITE_NAME - sleep 5 - """ diff --git a/flakytests/restart/21-task-elapsed.t b/flakytests/restart/21-task-elapsed.t index 5e93cdfe3ff..f5a9a81617e 100755 --- a/flakytests/restart/21-task-elapsed.t +++ b/flakytests/restart/21-task-elapsed.t @@ -39,9 +39,9 @@ run_ok "${TEST_NAME_BASE}-validate" cylc validate "${SUITE_NAME}" RUND="$(cylc get-global-config --print-run-dir)/${SUITE_NAME}" suite_run_ok "${TEST_NAME_BASE}-run" \ - timeout 120 cylc run "${SUITE_NAME}" --debug --no-detach + cylc run "${SUITE_NAME}" --debug --no-detach suite_run_ok "${TEST_NAME_BASE}-restart-1" \ - timeout 120 cylc restart "${SUITE_NAME}" --until=2028 --debug --no-detach + cylc restart "${SUITE_NAME}" --until=2028 --debug --no-detach sed -n '/LOADING task run times/,+2{s/^.* INFO - //;s/[0-9]\(,\|$\)/%d\1/g;p}' \ "${RUND}/log/suite/log" >'restart-1.out' contains_ok 'restart-1.out' <<'__OUT__' @@ -50,7 +50,7 @@ LOADING task run times + t1: %d,%d,%d,%d,%d __OUT__ suite_run_ok "${TEST_NAME_BASE}-restart-2" \ - timeout 120 cylc restart "${SUITE_NAME}" --until=2030 --debug --no-detach + cylc restart "${SUITE_NAME}" --until=2030 --debug --no-detach sed -n '/LOADING task run times/,+2{s/^.* INFO - //;s/[0-9]\(,\|$\)/%d\1/g;p}' \ "${RUND}/log/suite/log" >'restart-2.out' contains_ok 'restart-2.out' <<'__OUT__' @@ -59,14 +59,14 @@ LOADING task run times + t1: %d,%d,%d,%d,%d,%d,%d,%d,%d,%d __OUT__ suite_run_ok "${TEST_NAME_BASE}-restart-3" \ - timeout 120 cylc restart "${SUITE_NAME}" --until=2031 --hold + cylc restart "${SUITE_NAME}" --until=2031 --hold # allow the task pool to settle before requesting a dump cylc suite-state "${SUITE_NAME}" \ --task=t1 \ --point=2031 \ --status=running \ --interval=1 \ - --max-polls=10 + --max-polls=10 1>'/dev/null' 2>&1 cylc dump -r "${SUITE_NAME}" >'cylc-dump.out' test_dump 'cylc-dump.out' diff --git a/flakytests/restart/21-task-elapsed/suite.rc b/flakytests/restart/21-task-elapsed/suite.rc index 05bca759ed3..6056634b478 100644 --- a/flakytests/restart/21-task-elapsed/suite.rc +++ b/flakytests/restart/21-task-elapsed/suite.rc @@ -5,7 +5,7 @@ [[events]] abort on stalled = True abort on inactivity = True - inactivity = P1M + inactivity = PT3M startup handler = cylc release '%(suite)s' [scheduling] initial cycle point = 2016 diff --git a/flakytests/restart/46-stop-clock-time.t b/flakytests/restart/46-stop-clock-time.t index c0ba620f1e7..0eab000abe5 100644 --- a/flakytests/restart/46-stop-clock-time.t +++ b/flakytests/restart/46-stop-clock-time.t @@ -79,5 +79,13 @@ contains_ok 'log.edited' <<__LOG__ Wall clock stop time reached: ${CLOCKTIMESTR} __LOG__ +for i in {01..10}; do + ST_FILE="${SUITE_RUN_DIR}/log/job/1/t_i${i}/01/job.status" + if [[ -e "${ST_FILE}" ]]; then + JOB_ID="$(awk -F= '$1 == "CYLC_BATCH_SYS_JOB_ID" {print $2}' "${ST_FILE}")" + poll ps "${JOB_ID}" 1>'/dev/null' 2>&1 + fi +done + purge_suite "${SUITE_NAME}" exit diff --git a/flakytests/restart/47-no-auto-stop.t b/flakytests/restart/47-no-auto-stop.t index 4d3db7c023c..4bd24fcc336 100644 --- a/flakytests/restart/47-no-auto-stop.t +++ b/flakytests/restart/47-no-auto-stop.t @@ -41,7 +41,7 @@ init_suite "${TEST_NAME_BASE}" <<'__SUITERC__' [[events]] abort on stalled = True abort on inactivity = True - inactivity = PT10S + inactivity = PT3M [scheduling] [[graph]] R1 = t => t diff --git a/flakytests/shutdown/02-no-dir.t b/flakytests/shutdown/02-no-dir.t index c1463c943d3..c3029ec18a6 100755 --- a/flakytests/shutdown/02-no-dir.t +++ b/flakytests/shutdown/02-no-dir.t @@ -17,7 +17,7 @@ #------------------------------------------------------------------------------- # Test suite can shutdown successfully if its run dir is deleted . "$(dirname "$0")/test_header" -set_test_number 3 +set_test_number 4 install_suite "${TEST_NAME_BASE}" "${TEST_NAME_BASE}" run_ok "${TEST_NAME_BASE}-validate" cylc validate "${SUITE_NAME}" @@ -26,8 +26,8 @@ SYM_SUITE_RUND="${SUITE_RUN_DIR}-sym" SYM_SUITE_NAME="${SUITE_NAME}-sym" ln -s "$(basename "${SUITE_NAME}")" "${SYM_SUITE_RUND}" run_fail "${TEST_NAME_BASE}-run" cylc run "${SYM_SUITE_NAME}" --debug --no-detach -grep_ok 'CRITICAL - Suite shutting down - unable to open database file' \ - "${SUITE_RUN_DIR}/log/suite/log".* +grep_ok 'CRITICAL - Suite shutting down' "${SUITE_RUN_DIR}/log/suite/log".* +grep_ok 'unable to open database file' "${SUITE_RUN_DIR}/log/suite/log".* rm -f "${SYM_SUITE_RUND}" purge_suite "${SUITE_NAME}" diff --git a/flakytests/special/06-clock-triggered-iso.t b/flakytests/special/06-clock-triggered-iso.t index 1270f52f492..5a548672a11 100644 --- a/flakytests/special/06-clock-triggered-iso.t +++ b/flakytests/special/06-clock-triggered-iso.t @@ -56,5 +56,5 @@ run_fail "${TEST_NAME_BASE}-run-later" \ -s 'OFFSET=PT0S' \ -s 'TIMEOUT=PT12S' #------------------------------------------------------------------------------- -purge_suite "{$SUITE_NAME}" +purge_suite "${SUITE_NAME}" exit diff --git a/tests/api-suite-info/00-get-graph-raw-1/suite.rc b/tests/api-suite-info/00-get-graph-raw-1/suite.rc index 71d86f41309..18a9be85697 100644 --- a/tests/api-suite-info/00-get-graph-raw-1/suite.rc +++ b/tests/api-suite-info/00-get-graph-raw-1/suite.rc @@ -1,7 +1,3 @@ -[cylc] - [[reference test]] - required run mode = live - live mode suite timeout = PT30S [scheduling] [[graph]] R1 = t1 => t2 & t3 diff --git a/tests/api-suite-info/01-get-graph-raw-2/suite.rc b/tests/api-suite-info/01-get-graph-raw-2/suite.rc index e0a1480f9c6..1491d7c9218 100644 --- a/tests/api-suite-info/01-get-graph-raw-2/suite.rc +++ b/tests/api-suite-info/01-get-graph-raw-2/suite.rc @@ -1,8 +1,5 @@ [cylc] cycle point format = %Y - [[reference test]] - required run mode = live - live mode suite timeout = PT30S [scheduling] initial cycle point = 2020 final cycle point = 2021 diff --git a/tests/api-suite-info/02-get-graph-raw-3/suite.rc b/tests/api-suite-info/02-get-graph-raw-3/suite.rc index c309dd986d2..fbb8b95db67 100644 --- a/tests/api-suite-info/02-get-graph-raw-3/suite.rc +++ b/tests/api-suite-info/02-get-graph-raw-3/suite.rc @@ -1,8 +1,5 @@ [cylc] cycle point format = %Y - [[reference test]] - required run mode = live - live mode suite timeout = PT30S [scheduling] initial cycle point = 2020 final cycle point = 2021 diff --git a/tests/api-suite-info/03-get-graph-raw-4/suite.rc b/tests/api-suite-info/03-get-graph-raw-4/suite.rc index 2128da35192..784c7afd34a 100644 --- a/tests/api-suite-info/03-get-graph-raw-4/suite.rc +++ b/tests/api-suite-info/03-get-graph-raw-4/suite.rc @@ -1,8 +1,5 @@ [cylc] UTC mode = True - [[reference test]] - required run mode = live - live mode suite timeout = PT30S [scheduling] initial cycle point = 20200202T0000Z final cycle point = 20200203T0000Z diff --git a/tests/authentication/05-full-control.t b/tests/authentication/05-full-control.t index 9caaf84cb6a..353e36d3b12 100644 --- a/tests/authentication/05-full-control.t +++ b/tests/authentication/05-full-control.t @@ -17,10 +17,10 @@ # Test authentication - privilege 'full-control' (with passphrase). -. $(dirname $0)/test_header +. "$(dirname "$0")/test_header" set_test_number 12 -install_suite "${TEST_NAME_BASE}" basic +install_suite "${TEST_NAME_BASE}" 'basic' TEST_NAME="${TEST_NAME_BASE}-validate" run_ok "${TEST_NAME}" cylc validate "${SUITE_NAME}" @@ -168,20 +168,20 @@ __END__ TEST_NAME="${TEST_NAME_BASE}-show1" run_ok "${TEST_NAME}" cylc show "${SUITE_NAME}" cylc log "${SUITE_NAME}" > suite.log1 -grep_ok "\[client-command\] get_suite_info ${USER}@.*:cylc-show" suite.log1 +grep_ok "\\[client-command\\] get_suite_info ${USER}@.*cylc-show" 'suite.log1' # "cylc show" (task info) OK. TEST_NAME="${TEST_NAME_BASE}-show2" run_ok "${TEST_NAME}" cylc show "${SUITE_NAME}" foo cylc log "${SUITE_NAME}" > suite.log2 -grep_ok "\[client-command\] get_task_info ${USER}@.*:cylc-show" suite.log2 +grep_ok "\\[client-command\\] get_task_info ${USER}@.*cylc-show" 'suite.log2' # Commands OK. # (Reset to same state). TEST_NAME="${TEST_NAME_BASE}-trigger" run_ok "${TEST_NAME}" cylc reset "${SUITE_NAME}" -s failed foo 1 cylc log "${SUITE_NAME}" > suite.log3 -grep_ok "\[client-command\] reset_task_states ${USER}@.*:cylc-reset" suite.log3 +grep_ok "\\[client-command\\] reset_task_states ${USER}@.*cylc-reset" 'suite.log3' # Shutdown and purge. TEST_NAME="${TEST_NAME_BASE}-stop" diff --git a/tests/authentication/09-remote-suite-same-name/suite.rc b/tests/authentication/09-remote-suite-same-name/suite.rc index acd5e5c1c10..294e1c44b1c 100644 --- a/tests/authentication/09-remote-suite-same-name/suite.rc +++ b/tests/authentication/09-remote-suite-same-name/suite.rc @@ -1,8 +1,6 @@ #!jinja2 [cylc] UTC mode=True - [[reference test]] - live mode suite timeout = PT1M [scheduling] initial cycle point=1970 final cycle point=1970 diff --git a/tests/authentication/10-remote-suite-passphrase-cache/suite.rc b/tests/authentication/10-remote-suite-passphrase-cache/suite.rc index 0b9bb9dc90f..a47feccd5c2 100644 --- a/tests/authentication/10-remote-suite-passphrase-cache/suite.rc +++ b/tests/authentication/10-remote-suite-passphrase-cache/suite.rc @@ -2,7 +2,6 @@ UTC mode=True [[reference test]] expected task failures = t1.19700101T0000Z - live mode suite timeout = PT1M [scheduling] initial cycle point=1970 final cycle point=1970 diff --git a/tests/authentication/11-suite2-stop-suite1.t b/tests/authentication/11-suite2-stop-suite1.t index 755b1ee3048..0a19a802c7d 100755 --- a/tests/authentication/11-suite2-stop-suite1.t +++ b/tests/authentication/11-suite2-stop-suite1.t @@ -31,7 +31,8 @@ SUITE2_RUND="${RUND}/${NAME2}" mkdir -p "${SUITE2_RUND}" cat >"${SUITE2_RUND}/suite.rc" <<__SUITERC__ [cylc] - abort if any task fails=True + [[events]] + abort if any task fails=True [scheduling] [[graph]] R1=t1 diff --git a/tests/broadcast/00-simple.t b/tests/broadcast/00-simple.t index 0252eeb03be..55ca026b78f 100755 --- a/tests/broadcast/00-simple.t +++ b/tests/broadcast/00-simple.t @@ -18,19 +18,21 @@ # Test broadcasts . "$(dirname "$0")/test_header" -set_test_number 4 +set_test_number 5 install_suite "${TEST_NAME_BASE}" "${TEST_NAME_BASE}" run_ok "${TEST_NAME_BASE}-validate" cylc validate "${SUITE_NAME}" suite_run_ok "${TEST_NAME_BASE}-run" \ cylc run --debug --no-detach --reference-test "${SUITE_NAME}" +sort 'broadcast.log' >'broadcast.log.sorted' +cmp_ok 'broadcast.ref' 'broadcast.log.sorted' if ! which sqlite3 > /dev/null; then skip 2 "sqlite3 not installed?" exit 0 fi -DB_FILE="$(cylc get-global-config '--print-run-dir')/${SUITE_NAME}/log/db" +DB_FILE="${SUITE_RUN_DIR}/log/db" NAME='select-broadcast-events.out' sqlite3 "${DB_FILE}" \ 'SELECT change, point, namespace, key, value FROM broadcast_events diff --git a/tests/broadcast/00-simple/bin/complog.py b/tests/broadcast/00-simple/bin/complog.py deleted file mode 100755 index 986bdb94cfb..00000000000 --- a/tests/broadcast/00-simple/bin/complog.py +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env python3 - -import os -import sys - -print() -print("This is the broadcast test suite log comparator") -from cylc.flow.cylc_subproc import procopen - -event, suite = sys.argv[1], sys.argv[2] -if event != 'shutdown': - raise SystemExit("ERROR: run this as a shutdown event handler") - -try: - log_dir = os.path.expandvars(os.environ['CYLC_SUITE_LOG_DIR']) - suite_dir = os.path.expandvars(os.environ['CYLC_SUITE_DEF_PATH']) -except KeyError as exc: - raise SystemExit(exc) - -ref = os.path.join(suite_dir, 'broadcast.ref') -log = os.path.join(suite_dir, 'broadcast.log') - -fref = open(ref, 'r') -flog = open(log, 'r') - -reflines = fref.readlines() -loglines = flog.readlines() - -reflines.sort() -loglines.sort() - -if reflines != loglines: - sys.exit("ERROR: broadcast logs do not compare") -else: - print("broadcast logs compare OK") - -res = procopen(["cylc check-triggering " + event + " " + suite], usesh=True) -status = res.wait() -if status != 0: - sys.exit(1) diff --git a/tests/broadcast/00-simple/suite.rc b/tests/broadcast/00-simple/suite.rc index 9c3ae7bffc2..d6ca6470b1c 100644 --- a/tests/broadcast/00-simple/suite.rc +++ b/tests/broadcast/00-simple/suite.rc @@ -11,9 +11,6 @@ generated reference version. [cylc] cycle point format = %Y%m%dT%H - [[reference test]] - live mode suite timeout = PT2M - suite shutdown event handler = complog.py [scheduling] initial cycle point = 20100808T00 diff --git a/tests/broadcast/02-inherit/suite.rc b/tests/broadcast/02-inherit/suite.rc index 74d252267bb..385456d0958 100644 --- a/tests/broadcast/02-inherit/suite.rc +++ b/tests/broadcast/02-inherit/suite.rc @@ -4,9 +4,6 @@ description=Test Broadcast Inheritance [cylc] cycle point format = %Y%m%dT%H - [[reference test]] - required run mode=live - live mode suite timeout=PT1M [scheduling] initial cycle point = 20140101T00 final cycle point = 20140101T00 diff --git a/tests/broadcast/03-expire/suite.rc b/tests/broadcast/03-expire/suite.rc index 8b787645fee..42970a9a149 100644 --- a/tests/broadcast/03-expire/suite.rc +++ b/tests/broadcast/03-expire/suite.rc @@ -3,9 +3,6 @@ description=Test broadcast expire option [cylc] UTC mode = True - [[reference test]] - required run mode=live - live mode suite timeout=PT2M [scheduling] initial cycle point = 2020 final cycle point = 2025 diff --git a/tests/broadcast/04-empty/suite.rc b/tests/broadcast/04-empty/suite.rc index 8dafe89eafd..8a16446a623 100644 --- a/tests/broadcast/04-empty/suite.rc +++ b/tests/broadcast/04-empty/suite.rc @@ -1,10 +1,6 @@ [meta] title=broadcast empty description=Test broadcast of an empty string -[cylc] - [[reference test]] - required run mode=live - live mode suite timeout=PT1M [scheduling] [[graph]] R1="broadcast => t1" diff --git a/tests/broadcast/05-bad-point/suite.rc b/tests/broadcast/05-bad-point/suite.rc index e98f954cc01..a1aa7f82cf0 100644 --- a/tests/broadcast/05-bad-point/suite.rc +++ b/tests/broadcast/05-bad-point/suite.rc @@ -3,8 +3,8 @@ description=Test broadcast to an invalid cycle point fails. # And see github #1415 - it did cause the suite server program to abort. [cylc] - abort if any task fails = True [[events]] + abort if any task fails = True abort on timeout = True timeout=PT1M [scheduling] diff --git a/tests/broadcast/06-bad-namespace/suite.rc b/tests/broadcast/06-bad-namespace/suite.rc index b93c38718c4..90fc08a1e8d 100644 --- a/tests/broadcast/06-bad-namespace/suite.rc +++ b/tests/broadcast/06-bad-namespace/suite.rc @@ -2,8 +2,8 @@ title=broadcast bad namespace description=Test broadcast to an undefined namespace fails. [cylc] - abort if any task fails = True [[events]] + abort if any task fails = True abort on timeout = True timeout=PT1M [scheduling] diff --git a/tests/broadcast/07-float-setting/suite.rc b/tests/broadcast/07-float-setting/suite.rc index 429c54bfbcd..19a500d63b2 100644 --- a/tests/broadcast/07-float-setting/suite.rc +++ b/tests/broadcast/07-float-setting/suite.rc @@ -3,8 +3,6 @@ [cylc] UTC mode = True - [[reference test]] - live mode suite timeout = PT1M [scheduling] initial cycle point = 20100808T0000Z diff --git a/tests/broadcast/08-space/suite.rc b/tests/broadcast/08-space/suite.rc index 36658cbcade..a8a78b31196 100644 --- a/tests/broadcast/08-space/suite.rc +++ b/tests/broadcast/08-space/suite.rc @@ -2,9 +2,9 @@ title=broadcast section-space-key description=Test broadcast set section-space-key syntax [cylc] - abort if any task fails = True UTC mode = True [[events]] + abort if any task fails = True abort on timeout = True timeout=PT1M [scheduling] diff --git a/tests/broadcast/09-remote/suite.rc b/tests/broadcast/09-remote/suite.rc index dfb2ab2cf3f..b61753c07ab 100644 --- a/tests/broadcast/09-remote/suite.rc +++ b/tests/broadcast/09-remote/suite.rc @@ -1,9 +1,6 @@ #!Jinja2 [cylc] UTC mode = True - [[reference test]] - required run mode = live - live mode suite timeout = PT3M [scheduling] initial cycle point=1999 diff --git a/tests/broadcast/10-file-1/suite.rc b/tests/broadcast/10-file-1/suite.rc index 68af41b18c9..77b8de50b2e 100644 --- a/tests/broadcast/10-file-1/suite.rc +++ b/tests/broadcast/10-file-1/suite.rc @@ -1,7 +1,5 @@ [cylc] UTC mode = True - [[reference test]] - live mode suite timeout = PT1M [scheduling] [[graph]] R1 = "t1 => t2" diff --git a/tests/broadcast/11-file-2/suite.rc b/tests/broadcast/11-file-2/suite.rc index d59db4d9a42..f4c47f4ab13 100644 --- a/tests/broadcast/11-file-2/suite.rc +++ b/tests/broadcast/11-file-2/suite.rc @@ -1,7 +1,5 @@ [cylc] UTC mode = True - [[reference test]] - live mode suite timeout = PT1M [scheduling] [[graph]] R1 = "t1 => t2" diff --git a/tests/broadcast/12-file-stdin/suite.rc b/tests/broadcast/12-file-stdin/suite.rc index 47ea3d44e4a..efecb9da92b 100644 --- a/tests/broadcast/12-file-stdin/suite.rc +++ b/tests/broadcast/12-file-stdin/suite.rc @@ -1,7 +1,5 @@ [cylc] UTC mode = True - [[reference test]] - live mode suite timeout = PT1M [scheduling] [[graph]] R1 = "t1 => t2" diff --git a/tests/broadcast/13-file-cancel/suite.rc b/tests/broadcast/13-file-cancel/suite.rc index dd743f40c20..a4afec13161 100644 --- a/tests/broadcast/13-file-cancel/suite.rc +++ b/tests/broadcast/13-file-cancel/suite.rc @@ -1,7 +1,5 @@ [cylc] UTC mode = True - [[reference test]] - live mode suite timeout = PT1M [scheduling] [[graph]] R1 = "t1 => t2" diff --git a/tests/cli/02-now.t b/tests/cli/02-now.t index 309654766ba..13b181b3c7e 100755 --- a/tests/cli/02-now.t +++ b/tests/cli/02-now.t @@ -32,7 +32,7 @@ init_suite "${TEST_NAME_BASE}" <<'__SUITERC__' R1 = foo [runtime] [[foo]] - script = cylc stop --now --now "${CYLC_SUITE_NAME}"; sleep 5 + script = wait; cylc stop --now --now "${CYLC_SUITE_NAME}" __SUITERC__ run_ok "${TEST_NAME_BASE}-validate" cylc validate --icp='now' "${SUITE_NAME}" diff --git a/tests/clock-expire/00-basic/suite.rc b/tests/clock-expire/00-basic/suite.rc index 68850021810..99fa62f4852 100644 --- a/tests/clock-expire/00-basic/suite.rc +++ b/tests/clock-expire/00-basic/suite.rc @@ -5,8 +5,8 @@ Skip a daily post-processing workflow if the 'copy' task has expired.""" [cylc] cycle point format = %Y-%m-%dT%H - abort if any task fails = True [[events]] + abort if any task fails = True abort on timeout = True timeout = PT1M [scheduling] diff --git a/tests/cyclers/36-icp_fcp_notation.t b/tests/cyclers/36-icp_fcp_notation.t index 84d53b401fe..23f558db069 100755 --- a/tests/cyclers/36-icp_fcp_notation.t +++ b/tests/cyclers/36-icp_fcp_notation.t @@ -15,20 +15,14 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . #------------------------------------------------------------------------------- -# Test intercycle dependencies. +# Test initial and final cycle point special notation (^, $) . "$(dirname "$0")/test_header" -#------------------------------------------------------------------------------- -set_test_number 6 -#------------------------------------------------------------------------------- -# test initial and final cycle point special notation (^, $) +set_test_number 2 install_suite "${TEST_NAME_BASE}" "${TEST_NAME_BASE}" -suite_run_ok "${TEST_NAME_BASE}-run" cylc run --debug --no-detach "${SUITE_NAME}" - -grep_ok '\[foo\.20160101T0000Z\]' "${SUITE_RUN_DIR}/log/suite/log" -grep_ok '\[bar\.20160101T0000Z\]' "${SUITE_RUN_DIR}/log/suite/log" -grep_ok '\[baz\.20160101T0100Z\]' "${SUITE_RUN_DIR}/log/suite/log" -grep_ok '\[boo\.20160101T2300Z\]' "${SUITE_RUN_DIR}/log/suite/log" -grep_ok '\[bot\.20160102T0000Z\]' "${SUITE_RUN_DIR}/log/suite/log" +#------------------------------------------------------------------------------- +run_ok "${TEST_NAME_BASE}-validate" cylc validate "${SUITE_NAME}" +suite_run_ok "${TEST_NAME_BASE}-run" \ + cylc run --debug --no-detach --reference-test "${SUITE_NAME}" #------------------------------------------------------------------------------- purge_suite "${SUITE_NAME}" exit diff --git a/tests/cyclers/36-icp_fcp_notation/reference.log b/tests/cyclers/36-icp_fcp_notation/reference.log new file mode 100644 index 00000000000..029e77d32ce --- /dev/null +++ b/tests/cyclers/36-icp_fcp_notation/reference.log @@ -0,0 +1,7 @@ +Initial point: 20160101T0000Z +Final point: 20160102T0000Z +[foo.20160101T0000Z] -triggered off [] +[bar.20160101T0000Z] -triggered off [] +[baz.20160101T0100Z] -triggered off [] +[boo.20160101T2300Z] -triggered off [] +[bot.20160102T0000Z] -triggered off ['bar.20160101T0000Z', 'baz.20160101T0100Z', 'boo.20160101T2300Z', 'foo.20160101T0000Z'] diff --git a/tests/cyclers/360/suite.rc b/tests/cyclers/360/suite.rc index 0da86bcd22d..a39e5cdb7f3 100644 --- a/tests/cyclers/360/suite.rc +++ b/tests/cyclers/360/suite.rc @@ -1,8 +1,5 @@ [cylc] UTC mode = True - [[reference test]] - required run mode = live - live mode suite timeout = PT0.5M [scheduling] initial cycle point = 20130228T00 final cycle point = 20130301T00 diff --git a/tests/cyclers/365/suite.rc b/tests/cyclers/365/suite.rc index a5bfc9d0f9b..020f91142cb 100644 --- a/tests/cyclers/365/suite.rc +++ b/tests/cyclers/365/suite.rc @@ -1,8 +1,5 @@ [cylc] UTC mode = True - [[reference test]] - required run mode = live - live mode suite timeout = PT0.5M [scheduling] initial cycle point = 20120228T00 final cycle point = 20120301T00 diff --git a/tests/cyclers/366/suite.rc b/tests/cyclers/366/suite.rc index 0c049d7c2fe..3a2b65f6560 100644 --- a/tests/cyclers/366/suite.rc +++ b/tests/cyclers/366/suite.rc @@ -1,8 +1,5 @@ [cylc] UTC mode = True - [[reference test]] - required run mode = live - live mode suite timeout = PT0.5M [scheduling] initial cycle point = 20130228T00 final cycle point = 20130301T00 diff --git a/tests/cyclers/40-integer_exclusions_advanced.t b/tests/cyclers/40-integer_exclusions_advanced.t index 10b83eb6d20..71c46131882 100755 --- a/tests/cyclers/40-integer_exclusions_advanced.t +++ b/tests/cyclers/40-integer_exclusions_advanced.t @@ -16,32 +16,15 @@ # along with this program. If not, see . #------------------------------------------------------------------------------- # Test intercycle dependencies. -. $(dirname $0)/test_header -#------------------------------------------------------------------------------- -if [[ -f "$TEST_SOURCE_DIR/$TEST_NAME_BASE-find.out" ]]; then - set_test_number 4 -else - set_test_number 3 -fi -#------------------------------------------------------------------------------- -CHOSEN_SUITE=$(basename $0 | sed "s/^.*-\(.*\)\.t/\1/g") -install_suite $TEST_NAME_BASE $CHOSEN_SUITE -#------------------------------------------------------------------------------- -TEST_NAME=$TEST_NAME_BASE-validate -run_ok $TEST_NAME cylc validate "$SUITE_NAME" -#------------------------------------------------------------------------------- -TEST_NAME=$TEST_NAME_BASE-graph -graph_suite "$SUITE_NAME" "$SUITE_NAME.graph.plain" -cmp_ok "$SUITE_NAME.graph.plain" "$TEST_SOURCE_DIR/$CHOSEN_SUITE/graph.plain.ref" -#------------------------------------------------------------------------------- -TEST_NAME=$TEST_NAME_BASE-run -suite_run_ok $TEST_NAME cylc run --reference-test --debug --no-detach $SUITE_NAME -#------------------------------------------------------------------------------- -if [[ -f "$TEST_SOURCE_DIR/$TEST_NAME_BASE-find.out" ]]; then - TEST_NAME="$TEST_NAME_BASE-find" - SUITE_DIR="$(cylc get-global-config --print-run-dir)/$SUITE_NAME" - (cd "$SUITE_DIR"; find log/job work -type f | sort -V) >"$TEST_NAME" - cmp_ok "$TEST_NAME" "$TEST_SOURCE_DIR/$TEST_NAME_BASE-find.out" -fi -#------------------------------------------------------------------------------- -purge_suite $SUITE_NAME +. "$(dirname "$0")/test_header" +set_test_number 3 +install_suite "${TEST_NAME_BASE}" 'integer_exclusions_advanced' +#------------------------------------------------------------------------------- +run_ok "${TEST_NAME_BASE}-validate" cylc validate "${SUITE_NAME}" +graph_suite "${SUITE_NAME}" "${SUITE_NAME}.graph.plain" +cmp_ok "${SUITE_NAME}.graph.plain" 'graph.plain.ref' +suite_run_ok "${TEST_NAME_BASE}-run" \ + cylc run --reference-test --debug --no-detach "${SUITE_NAME}" +#------------------------------------------------------------------------------- +purge_suite "${SUITE_NAME}" +exit diff --git a/tests/cyclers/aeon/suite.rc b/tests/cyclers/aeon/suite.rc index 0c208b7bee4..e018993a676 100644 --- a/tests/cyclers/aeon/suite.rc +++ b/tests/cyclers/aeon/suite.rc @@ -1,8 +1,6 @@ [cylc] cycle point num expanded year digits = 7 UTC mode = True - [[reference test]] - live mode suite timeout = PT2M [scheduling] initial cycle point = -13800000000-02-29T05:30 # Big Bang final cycle point = +05400000000-12-31T23:59 # Sun leaves main sequence diff --git a/tests/cyclers/day_of_week/suite.rc b/tests/cyclers/day_of_week/suite.rc index 8cc3eb97d30..d2782855d67 100644 --- a/tests/cyclers/day_of_week/suite.rc +++ b/tests/cyclers/day_of_week/suite.rc @@ -1,8 +1,5 @@ [cylc] UTC mode = True - [[reference test]] - required run mode = live - live mode suite timeout = PT0.5M [scheduling] initial cycle point = 20100101T0000Z diff --git a/tests/cyclers/integer1/suite.rc b/tests/cyclers/integer1/suite.rc index 0178fd0a182..40734b79a44 100644 --- a/tests/cyclers/integer1/suite.rc +++ b/tests/cyclers/integer1/suite.rc @@ -1,6 +1,3 @@ -[cylc] - [[reference test]] - live mode suite timeout = PT3M [scheduling] initial cycle point = 1 final cycle point = +P15 # = 16 diff --git a/tests/cyclers/integer_exclusions_advanced/suite.rc b/tests/cyclers/integer_exclusions_advanced/suite.rc index f5fd74dadcd..b511ac2309f 100644 --- a/tests/cyclers/integer_exclusions_advanced/suite.rc +++ b/tests/cyclers/integer_exclusions_advanced/suite.rc @@ -1,6 +1,3 @@ -[cylc] - [[reference test]] - live mode suite timeout = PT3M [scheduling] initial cycle point = 1 final cycle point = +P15 # = 16 @@ -15,14 +12,11 @@ [runtime] [[foo]] script = """ -sleep 5 -cylc task message "the cheese is ready" -sleep 5 -touch typing - """ +wait +cylc message -- "${CYLC_SUITE_NAME}" "${CYLC_TASK_JOB}" 'the cheese is ready' +""" [[[outputs]]] - out1 = "the cheese is ready" - + out1 = the cheese is ready [visualization] initial cycle point = 1 final cycle point = 16 diff --git a/tests/cyclers/monthly/suite.rc b/tests/cyclers/monthly/suite.rc index 6fe6438c9d7..95b1757d70f 100644 --- a/tests/cyclers/monthly/suite.rc +++ b/tests/cyclers/monthly/suite.rc @@ -1,7 +1,5 @@ [cylc] UTC mode = True - [[reference test]] - live mode suite timeout = PT2M [scheduling] initial cycle point = 20000131T0100Z final cycle point = 2001 diff --git a/tests/cyclers/monthly_complex/suite.rc b/tests/cyclers/monthly_complex/suite.rc index da84890fbe0..15590699990 100644 --- a/tests/cyclers/monthly_complex/suite.rc +++ b/tests/cyclers/monthly_complex/suite.rc @@ -1,7 +1,5 @@ [cylc] UTC mode = True - [[reference test]] - live mode suite timeout = PT2M [scheduling] initial cycle point = 20000331T0100Z final cycle point = 2001 diff --git a/tests/cyclers/multidaily/suite.rc b/tests/cyclers/multidaily/suite.rc index 1cd54c22826..beb66dab16d 100644 --- a/tests/cyclers/multidaily/suite.rc +++ b/tests/cyclers/multidaily/suite.rc @@ -1,7 +1,5 @@ [cylc] cycle point time zone = Z - [[reference test]] - live mode suite timeout = PT2M [scheduling] initial cycle point = 20001231T0100 final cycle point = 20010114 diff --git a/tests/cyclers/multidaily_local/suite.rc b/tests/cyclers/multidaily_local/suite.rc index 8c42552b7a0..c3326c0ba61 100644 --- a/tests/cyclers/multidaily_local/suite.rc +++ b/tests/cyclers/multidaily_local/suite.rc @@ -1,6 +1,3 @@ -[cylc] - [[reference test]] - live mode suite timeout = PT2M [scheduling] initial cycle point = 20001231T0100 final cycle point = 20010114 diff --git a/tests/cyclers/multihourly/suite.rc b/tests/cyclers/multihourly/suite.rc index 46fc9eae69e..f0b371ab0ed 100644 --- a/tests/cyclers/multihourly/suite.rc +++ b/tests/cyclers/multihourly/suite.rc @@ -1,7 +1,5 @@ [cylc] cycle point time zone = +13 - [[reference test]] - live mode suite timeout = PT2M [scheduling] initial cycle point = 20000131T0100Z final cycle point = 20000202T0600+0600 diff --git a/tests/cyclers/multimonthly/suite.rc b/tests/cyclers/multimonthly/suite.rc index 02803492415..d7a029bae3f 100644 --- a/tests/cyclers/multimonthly/suite.rc +++ b/tests/cyclers/multimonthly/suite.rc @@ -1,7 +1,5 @@ [cylc] UTC mode = True - [[reference test]] - live mode suite timeout = PT2M [scheduling] initial cycle point = 1000 final cycle point = 1001 diff --git a/tests/cyclers/multiweekly/suite.rc b/tests/cyclers/multiweekly/suite.rc index 68502ad4067..77e2acc95b9 100644 --- a/tests/cyclers/multiweekly/suite.rc +++ b/tests/cyclers/multiweekly/suite.rc @@ -1,7 +1,5 @@ [cylc] UTC mode = True - [[reference test]] - live mode suite timeout = PT3M [scheduling] initial cycle point = 1000W011 final cycle point = 1000W064 diff --git a/tests/cyclers/multiyearly/suite.rc b/tests/cyclers/multiyearly/suite.rc index 475575106c5..94798c8db81 100644 --- a/tests/cyclers/multiyearly/suite.rc +++ b/tests/cyclers/multiyearly/suite.rc @@ -1,7 +1,5 @@ [cylc] UTC mode = True - [[reference test]] - live mode suite timeout = PT2M [scheduling] initial cycle point = 1005 final cycle point = 1014 diff --git a/tests/cyclers/r1_initial_immortal/suite.rc b/tests/cyclers/r1_initial_immortal/suite.rc index 3b0a63195d3..f3ed4d82ea5 100644 --- a/tests/cyclers/r1_initial_immortal/suite.rc +++ b/tests/cyclers/r1_initial_immortal/suite.rc @@ -1,7 +1,5 @@ [cylc] UTC mode = True - [[reference test]] - live mode suite timeout = PT2M [scheduling] initial cycle point = 20140101 [[graph]] diff --git a/tests/cyclers/yearly/suite.rc b/tests/cyclers/yearly/suite.rc index d190a435f17..91e6e979092 100644 --- a/tests/cyclers/yearly/suite.rc +++ b/tests/cyclers/yearly/suite.rc @@ -1,7 +1,5 @@ [cylc] UTC mode = True - [[reference test]] - live mode suite timeout = PT3M [scheduling] initial cycle point = 2005023T12 final cycle point = 2008001T11 diff --git a/tests/cylc-cat-log/02-remote-custom-runtime-viewer-pbs/suite.rc b/tests/cylc-cat-log/02-remote-custom-runtime-viewer-pbs/suite.rc index 31fa735f4ab..356a24d76d7 100644 --- a/tests/cylc-cat-log/02-remote-custom-runtime-viewer-pbs/suite.rc +++ b/tests/cylc-cat-log/02-remote-custom-runtime-viewer-pbs/suite.rc @@ -1,8 +1,4 @@ #!Jinja2 -[cylc] - [[reference test]] - required run mode = live - live mode suite timeout = PT3M [scheduling] [[graph]] R1 = a-task:echo => b-task diff --git a/tests/cylc-cat-log/04-local-tail.t b/tests/cylc-cat-log/04-local-tail.t index 082f9792df9..a28979f2a29 100755 --- a/tests/cylc-cat-log/04-local-tail.t +++ b/tests/cylc-cat-log/04-local-tail.t @@ -18,7 +18,7 @@ # Test "cylc cat-log" with a custom tail command. . $(dirname $0)/test_header #------------------------------------------------------------------------------- -set_test_number 4 +set_test_number 3 install_suite $TEST_NAME_BASE $TEST_NAME_BASE #------------------------------------------------------------------------------- TEST_NAME=$TEST_NAME_BASE-validate @@ -39,7 +39,6 @@ TEST_NAME=$TEST_NAME_BASE-cat-log cylc cat-log $SUITE_NAME -f o -m t foo.1 > ${TEST_NAME}.out grep_ok "HELLO from foo 1" ${TEST_NAME}.out #------------------------------------------------------------------------------- -TEST_NAME=$TEST_NAME_BASE-stop -run_ok $TEST_NAME cylc stop --kill --max-polls=10 --interval=1 $SUITE_NAME +cylc stop --kill --max-polls=20 --interval=1 "${SUITE_NAME}" #------------------------------------------------------------------------------- purge_suite $SUITE_NAME diff --git a/tests/cylc-get-config/00-simple/section2.stdout b/tests/cylc-get-config/00-simple/section2.stdout index 16fe0ade618..c71bcf6a201 100644 --- a/tests/cylc-get-config/00-simple/section2.stdout +++ b/tests/cylc-get-config/00-simple/section2.stdout @@ -53,7 +53,7 @@ speedup factor = disable task event handlers = True default run length = PT10S - time limit buffer = PT10S + time limit buffer = PT30S [[[suite state polling]]] interval = host = @@ -131,7 +131,7 @@ speedup factor = disable task event handlers = True default run length = PT10S - time limit buffer = PT10S + time limit buffer = PT30S [[[suite state polling]]] interval = host = @@ -210,7 +210,7 @@ speedup factor = disable task event handlers = True default run length = PT10S - time limit buffer = PT10S + time limit buffer = PT30S [[[suite state polling]]] interval = host = @@ -289,7 +289,7 @@ speedup factor = disable task event handlers = True default run length = PT10S - time limit buffer = PT10S + time limit buffer = PT30S [[[suite state polling]]] interval = host = @@ -368,7 +368,7 @@ speedup factor = disable task event handlers = True default run length = PT10S - time limit buffer = PT10S + time limit buffer = PT30S [[[suite state polling]]] interval = host = @@ -447,7 +447,7 @@ speedup factor = disable task event handlers = True default run length = PT10S - time limit buffer = PT10S + time limit buffer = PT30S [[[suite state polling]]] interval = host = @@ -526,7 +526,7 @@ speedup factor = disable task event handlers = True default run length = PT10S - time limit buffer = PT10S + time limit buffer = PT30S [[[suite state polling]]] interval = host = @@ -604,7 +604,7 @@ speedup factor = disable task event handlers = True default run length = PT10S - time limit buffer = PT10S + time limit buffer = PT30S [[[suite state polling]]] interval = host = @@ -683,7 +683,7 @@ speedup factor = disable task event handlers = True default run length = PT10S - time limit buffer = PT10S + time limit buffer = PT30S [[[suite state polling]]] interval = host = @@ -762,7 +762,7 @@ speedup factor = disable task event handlers = True default run length = PT10S - time limit buffer = PT10S + time limit buffer = PT30S [[[suite state polling]]] interval = host = @@ -840,7 +840,7 @@ speedup factor = disable task event handlers = True default run length = PT10S - time limit buffer = PT10S + time limit buffer = PT30S [[[suite state polling]]] interval = host = @@ -919,7 +919,7 @@ speedup factor = disable task event handlers = True default run length = PT10S - time limit buffer = PT10S + time limit buffer = PT30S [[[suite state polling]]] interval = host = @@ -998,7 +998,7 @@ speedup factor = disable task event handlers = True default run length = PT10S - time limit buffer = PT10S + time limit buffer = PT30S [[[suite state polling]]] interval = host = diff --git a/tests/cylc-get-cylc-version/00-basic/suite.rc b/tests/cylc-get-cylc-version/00-basic/suite.rc index f88e6fc7269..3930ed10a32 100644 --- a/tests/cylc-get-cylc-version/00-basic/suite.rc +++ b/tests/cylc-get-cylc-version/00-basic/suite.rc @@ -3,11 +3,6 @@ description = """A task compares its own cylc version to that running the test suite (should be the same).""" -[cylc] - [[reference test]] - required run mode = live - live mode suite timeout = PT30S - [scheduling] [[graph]] R1 = foo diff --git a/tests/cylc-insert/00-insert/suite.rc b/tests/cylc-insert/00-insert/suite.rc index 62e7f19f606..a513ce564f4 100644 --- a/tests/cylc-insert/00-insert/suite.rc +++ b/tests/cylc-insert/00-insert/suite.rc @@ -8,9 +8,6 @@ duration of the suite; and the other is set to stop after two cycles.""" [cylc] cycle point format = %Y%m%dT%H - [[reference test]] - required run mode = live - live mode suite timeout = PT1M [scheduling] initial cycle point = 20140101T00 diff --git a/tests/cylc-insert/01-insert-bad-cycle-point/suite.rc b/tests/cylc-insert/01-insert-bad-cycle-point/suite.rc index 9e079ca7b50..4ff583e54dd 100644 --- a/tests/cylc-insert/01-insert-bad-cycle-point/suite.rc +++ b/tests/cylc-insert/01-insert-bad-cycle-point/suite.rc @@ -3,9 +3,6 @@ [cylc] cycle point time zone = +01 - [[reference test]] - required run mode = live - live mode suite timeout = PT10S [scheduling] initial cycle point = 20140101T00 diff --git a/tests/cylc-insert/02-insert-bad-stop-cycle-point/suite.rc b/tests/cylc-insert/02-insert-bad-stop-cycle-point/suite.rc index 6552a487752..3416239160d 100644 --- a/tests/cylc-insert/02-insert-bad-stop-cycle-point/suite.rc +++ b/tests/cylc-insert/02-insert-bad-stop-cycle-point/suite.rc @@ -3,9 +3,6 @@ [cylc] cycle point time zone = +01 - [[reference test]] - required run mode = live - live mode suite timeout = PT10S [scheduling] initial cycle point = 20140101T00 diff --git a/tests/cylc-insert/03-insert-old/suite.rc b/tests/cylc-insert/03-insert-old/suite.rc index 60ac9022bda..85938f9964d 100644 --- a/tests/cylc-insert/03-insert-old/suite.rc +++ b/tests/cylc-insert/03-insert-old/suite.rc @@ -3,9 +3,6 @@ [cylc] UTC mode = True - [[reference test]] - required run mode = live - live mode suite timeout = PT1M [scheduling] initial cycle point = 20140101T00 diff --git a/tests/cylc-insert/04-insert-family/suite.rc b/tests/cylc-insert/04-insert-family/suite.rc index abb80560538..73edd35c269 100644 --- a/tests/cylc-insert/04-insert-family/suite.rc +++ b/tests/cylc-insert/04-insert-family/suite.rc @@ -3,10 +3,6 @@ description = """Two families are removed, then one is re-inserted. The ref test will fail if either operation fails to work properly.""" -[cylc] - [[reference test]] - required run mode = live - live mode suite timeout = PT1M [scheduling] initial cycle point = 1 final cycle point = 2 diff --git a/tests/cylc-insert/05-insert-compat/suite.rc b/tests/cylc-insert/05-insert-compat/suite.rc index 53d514352a3..79662b11fac 100644 --- a/tests/cylc-insert/05-insert-compat/suite.rc +++ b/tests/cylc-insert/05-insert-compat/suite.rc @@ -8,9 +8,6 @@ duration of the suite; and the other is set to stop after two cycles.""" [cylc] cycle point format = %Y%m%dT%H - [[reference test]] - required run mode = live - live mode suite timeout = PT1M [scheduling] initial cycle point = 20140101T00 diff --git a/tests/cylc-insert/06-insert-bad-cycle-point-compat/suite.rc b/tests/cylc-insert/06-insert-bad-cycle-point-compat/suite.rc index 6dd37c2d2ac..e8a9129658d 100644 --- a/tests/cylc-insert/06-insert-bad-cycle-point-compat/suite.rc +++ b/tests/cylc-insert/06-insert-bad-cycle-point-compat/suite.rc @@ -3,9 +3,6 @@ [cylc] cycle point time zone = +01 - [[reference test]] - required run mode = live - live mode suite timeout = PT10S [scheduling] initial cycle point = 20140101T00 diff --git a/tests/cylc-insert/07-insert-bad-stop-cycle-point/suite.rc b/tests/cylc-insert/07-insert-bad-stop-cycle-point/suite.rc index 3734d3de387..237fb585785 100644 --- a/tests/cylc-insert/07-insert-bad-stop-cycle-point/suite.rc +++ b/tests/cylc-insert/07-insert-bad-stop-cycle-point/suite.rc @@ -3,9 +3,6 @@ [cylc] cycle point time zone = +01 - [[reference test]] - required run mode = live - live mode suite timeout = PT10S [scheduling] initial cycle point = 20140101T00 diff --git a/tests/cylc-insert/08-insert-family-compat/suite.rc b/tests/cylc-insert/08-insert-family-compat/suite.rc index 228ac38f928..97f025ecb9e 100644 --- a/tests/cylc-insert/08-insert-family-compat/suite.rc +++ b/tests/cylc-insert/08-insert-family-compat/suite.rc @@ -3,10 +3,6 @@ description = """Two families are removed, then one is re-inserted. The ref test will fail if either operation fails to work properly.""" -[cylc] - [[reference test]] - required run mode = live - live mode suite timeout = PT1M [scheduling] initial cycle point = 1 final cycle point = 2 diff --git a/tests/cylc-insert/09-insert-no-cycle-point/suite.rc b/tests/cylc-insert/09-insert-no-cycle-point/suite.rc index d34d5a05bda..4548059c723 100644 --- a/tests/cylc-insert/09-insert-no-cycle-point/suite.rc +++ b/tests/cylc-insert/09-insert-no-cycle-point/suite.rc @@ -3,9 +3,6 @@ [cylc] cycle point time zone = +01 - [[reference test]] - required run mode = live - live mode suite timeout = PT10S [scheduling] initial cycle point = 20140101T00 diff --git a/tests/cylc-insert/11-wildcard/suite.rc b/tests/cylc-insert/11-wildcard/suite.rc index 79f86eb53cf..6491995b532 100644 --- a/tests/cylc-insert/11-wildcard/suite.rc +++ b/tests/cylc-insert/11-wildcard/suite.rc @@ -1,9 +1,5 @@ [meta] title = cylc insert with wild card in task name string -[cylc] - [[reference test]] - required run mode = live - live mode suite timeout = PT1M [scheduling] [[special tasks]] exclude at start-up = t1, t2 diff --git a/tests/cylc-insert/13-family-submit-num/suite.rc b/tests/cylc-insert/13-family-submit-num/suite.rc index a30161b0e65..73693c27287 100644 --- a/tests/cylc-insert/13-family-submit-num/suite.rc +++ b/tests/cylc-insert/13-family-submit-num/suite.rc @@ -1,6 +1,6 @@ [cylc] - abort if any task fails = True [[events]] + abort if any task fails = True abort on stalled = True abort on inactivity = True inactivity = PT2M diff --git a/tests/cylc-kill/00-multi-hosts-compat/suite.rc b/tests/cylc-kill/00-multi-hosts-compat/suite.rc index 4550e43ad83..af33f80c303 100644 --- a/tests/cylc-kill/00-multi-hosts-compat/suite.rc +++ b/tests/cylc-kill/00-multi-hosts-compat/suite.rc @@ -2,8 +2,6 @@ [cylc] UTC mode = True [[reference test]] - required run mode = live - live mode suite timeout = PT1M expected task failures = local-1.1, local-2.1, local-3.1, remote-1.1, remote-2.1 [scheduling] [[graph]] diff --git a/tests/cylc-kill/01-multi-hosts/suite.rc b/tests/cylc-kill/01-multi-hosts/suite.rc index a4b30fb2c94..5981a626d76 100644 --- a/tests/cylc-kill/01-multi-hosts/suite.rc +++ b/tests/cylc-kill/01-multi-hosts/suite.rc @@ -2,8 +2,6 @@ [cylc] UTC mode = True [[reference test]] - required run mode = live - live mode suite timeout = PT1M expected task failures = local-1.1, local-2.1, local-3.1, remote-1.1, remote-2.1 [scheduling] [[graph]] diff --git a/tests/cylc-message/00-ssh/suite.rc b/tests/cylc-message/00-ssh/suite.rc index ff4498feb75..505182807d3 100644 --- a/tests/cylc-message/00-ssh/suite.rc +++ b/tests/cylc-message/00-ssh/suite.rc @@ -1,8 +1,6 @@ #!jinja2 [cylc] UTC mode = True # Ignore DST - [[reference test]] - live mode suite timeout = PT1M [scheduling] [[graph]] diff --git a/tests/cylc-ping/simple/suite.rc b/tests/cylc-ping/simple/suite.rc index f08c2466789..754d13a90f1 100644 --- a/tests/cylc-ping/simple/suite.rc +++ b/tests/cylc-ping/simple/suite.rc @@ -1,7 +1,3 @@ -[cylc] - [[reference test]] - required run mode = live - live mode suite timeout = PT30S [scheduling] [[graph]] R1 = "foo => bar" diff --git a/tests/cylc-poll/00-basic/suite.rc b/tests/cylc-poll/00-basic/suite.rc index 1f13fb97341..6ff76649686 100644 --- a/tests/cylc-poll/00-basic/suite.rc +++ b/tests/cylc-poll/00-basic/suite.rc @@ -1,7 +1,3 @@ -[cylc] - [[reference test]] - required run mode = live - live mode suite timeout = PT1M [scheduling] [[graph]] R1 = a:start => b diff --git a/tests/cylc-poll/01-task-failed/suite.rc b/tests/cylc-poll/01-task-failed/suite.rc index 577e9248aa8..7c021290967 100644 --- a/tests/cylc-poll/01-task-failed/suite.rc +++ b/tests/cylc-poll/01-task-failed/suite.rc @@ -6,8 +6,6 @@ suicide via a :fail trigger, and the suite to shut down successfully.""" [cylc] [[reference test]] - required run mode = live - live mode suite timeout = PT30S expected task failures = a.1 [scheduling] diff --git a/tests/cylc-poll/02-task-submit-failed/suite.rc b/tests/cylc-poll/02-task-submit-failed/suite.rc index 9769578c0c2..983405d6727 100644 --- a/tests/cylc-poll/02-task-submit-failed/suite.rc +++ b/tests/cylc-poll/02-task-submit-failed/suite.rc @@ -1,6 +1,5 @@ [cylc] [[reference test]] - allow task failures = True expected task failures = foo.1 [scheduling] [[graph]] diff --git a/tests/cylc-poll/04-poll-multi-hosts/suite.rc b/tests/cylc-poll/04-poll-multi-hosts/suite.rc index 76f6bdefec0..bb72524b1ab 100644 --- a/tests/cylc-poll/04-poll-multi-hosts/suite.rc +++ b/tests/cylc-poll/04-poll-multi-hosts/suite.rc @@ -2,8 +2,6 @@ [cylc] UTC mode = True [[reference test]] - required run mode = live - live mode suite timeout = PT1M expected task failures = local-fail-1.1, local-fail-2.1, remote-fail-1.1 [scheduling] [[graph]] diff --git a/tests/cylc-poll/05-poll-multi-messages/suite.rc b/tests/cylc-poll/05-poll-multi-messages/suite.rc index 6b51ab70438..247dea3d06a 100644 --- a/tests/cylc-poll/05-poll-multi-messages/suite.rc +++ b/tests/cylc-poll/05-poll-multi-messages/suite.rc @@ -1,9 +1,6 @@ #!Jinja2 [cylc] UTC mode = True - [[reference test]] - required run mode = live - live mode suite timeout = PT1M [scheduling] [[graph]] R1=""" diff --git a/tests/cylc-poll/06-loadleveler/suite.rc b/tests/cylc-poll/06-loadleveler/suite.rc index 68ab2604907..9d4801be205 100644 --- a/tests/cylc-poll/06-loadleveler/suite.rc +++ b/tests/cylc-poll/06-loadleveler/suite.rc @@ -1,8 +1,4 @@ #!Jinja2 -[cylc] - [[reference test]] - required run mode = live - live mode suite timeout = PT1M [scheduling] [[graph]] R1 = a:start => b diff --git a/tests/cylc-poll/07-pbs/suite.rc b/tests/cylc-poll/07-pbs/suite.rc index 3904ef7fe5b..b8ec7d7bd7b 100644 --- a/tests/cylc-poll/07-pbs/suite.rc +++ b/tests/cylc-poll/07-pbs/suite.rc @@ -1,8 +1,4 @@ #!Jinja2 -[cylc] - [[reference test]] - required run mode = live - live mode suite timeout = PT5M [scheduling] [[graph]] R1 = a:start => b diff --git a/tests/cylc-poll/08-slurm/suite.rc b/tests/cylc-poll/08-slurm/suite.rc index 200d165e816..6a9e42f50e5 100644 --- a/tests/cylc-poll/08-slurm/suite.rc +++ b/tests/cylc-poll/08-slurm/suite.rc @@ -1,8 +1,4 @@ #!Jinja2 -[cylc] - [[reference test]] - required run mode = live - live mode suite timeout = PT1M [scheduling] [[graph]] R1 = a:start => b diff --git a/tests/cylc-poll/09-lsf/suite.rc b/tests/cylc-poll/09-lsf/suite.rc index 794b0761e27..ad8f7499767 100644 --- a/tests/cylc-poll/09-lsf/suite.rc +++ b/tests/cylc-poll/09-lsf/suite.rc @@ -1,8 +1,4 @@ #!Jinja2 -[cylc] - [[reference test]] - required run mode = live - live mode suite timeout = PT1M [scheduling] [[graph]] R1 = a:start => b diff --git a/tests/cylc-poll/10-basic-compat/suite.rc b/tests/cylc-poll/10-basic-compat/suite.rc index 50a6c48ff7a..14a52d0722d 100644 --- a/tests/cylc-poll/10-basic-compat/suite.rc +++ b/tests/cylc-poll/10-basic-compat/suite.rc @@ -1,7 +1,3 @@ -[cylc] - [[reference test]] - required run mode = live - live mode suite timeout=PT1M [scheduling] [[graph]] R1 = a:start => b diff --git a/tests/cylc-poll/11-event-time/suite.rc b/tests/cylc-poll/11-event-time/suite.rc index 633326c8fb7..7b6df644cad 100644 --- a/tests/cylc-poll/11-event-time/suite.rc +++ b/tests/cylc-poll/11-event-time/suite.rc @@ -1,8 +1,3 @@ -[cylc] - [[reference test]] - required run mode = live - live mode suite timeout = PT30S - [scheduling] [[graph]] R1="w1:started => w2" diff --git a/tests/cylc-poll/13-comm-method/suite.rc b/tests/cylc-poll/13-comm-method/suite.rc index fdd7c3841cc..d9b8eb49d26 100644 --- a/tests/cylc-poll/13-comm-method/suite.rc +++ b/tests/cylc-poll/13-comm-method/suite.rc @@ -1,7 +1,3 @@ -[cylc] - [[reference test]] - live mode suite timeout = PT1M - [scheduling] [[graph]] R1 = t1 & t2 diff --git a/tests/cylc-poll/14-intervals/suite.rc b/tests/cylc-poll/14-intervals/suite.rc index 3ddb05cf7a4..9deb4925dd4 100644 --- a/tests/cylc-poll/14-intervals/suite.rc +++ b/tests/cylc-poll/14-intervals/suite.rc @@ -1,7 +1,3 @@ -[cylc] - [[reference test]] - live mode suite timeout = PT1M - [scheduling] [[graph]] R1 = t1 & t2 diff --git a/tests/cylc-poll/17-pbs-cant-connect/suite.rc b/tests/cylc-poll/17-pbs-cant-connect/suite.rc index bee9fc1728c..e8697419b2b 100644 --- a/tests/cylc-poll/17-pbs-cant-connect/suite.rc +++ b/tests/cylc-poll/17-pbs-cant-connect/suite.rc @@ -1,9 +1,4 @@ #!Jinja2 -[cylc] - [[reference test]] - required run mode = live - live mode suite timeout = PT5M - [scheduling] [[graph]] R1 = t1 diff --git a/tests/cylc-remove/00-simple/suite.rc b/tests/cylc-remove/00-simple/suite.rc index 99555c864e4..55e7a7bbec5 100644 --- a/tests/cylc-remove/00-simple/suite.rc +++ b/tests/cylc-remove/00-simple/suite.rc @@ -1,8 +1,6 @@ [cylc] [[reference test]] - required run mode = live expected task failures = c.1 - live mode suite timeout=PT1M [scheduling] [[graph]] diff --git a/tests/cylc-remove/01-simple-comat/suite.rc b/tests/cylc-remove/01-simple-comat/suite.rc index 28a31d30dc8..b9cead733db 100644 --- a/tests/cylc-remove/01-simple-comat/suite.rc +++ b/tests/cylc-remove/01-simple-comat/suite.rc @@ -1,8 +1,6 @@ [cylc] [[reference test]] - required run mode = live expected task failures = c.1 - live mode suite timeout=PT1M [scheduling] [[graph]] diff --git a/tests/cylc-remove/02-cycling/suite.rc b/tests/cylc-remove/02-cycling/suite.rc index 93c6f1be16e..986de7d154c 100644 --- a/tests/cylc-remove/02-cycling/suite.rc +++ b/tests/cylc-remove/02-cycling/suite.rc @@ -1,9 +1,6 @@ [cylc] UTC mode = True cycle point format = %Y - [[reference test]] - required run mode = live - live mode suite timeout = PT30S [scheduling] initial cycle point = 2020 diff --git a/tests/cylc-reset/00-compat/suite.rc b/tests/cylc-reset/00-compat/suite.rc index 45ac132bab9..003e568edde 100644 --- a/tests/cylc-reset/00-compat/suite.rc +++ b/tests/cylc-reset/00-compat/suite.rc @@ -2,8 +2,6 @@ UTC mode = True [[reference test]] expected task failures = fixable.1 - live mode suite timeout = PT1M - required run mode = live [scheduling] [[graph]] R1 = """ diff --git a/tests/cylc-reset/01-filter-failed/suite.rc b/tests/cylc-reset/01-filter-failed/suite.rc index ca250d3b275..82033b001d7 100644 --- a/tests/cylc-reset/01-filter-failed/suite.rc +++ b/tests/cylc-reset/01-filter-failed/suite.rc @@ -2,8 +2,6 @@ UTC mode = True [[reference test]] expected task failures = fixable1.1, fixable2.1, fixable3.1 - live mode suite timeout = PT1M - required run mode = live [scheduling] [[graph]] R1 = """ diff --git a/tests/cylc-reset/03-output-2/suite.rc b/tests/cylc-reset/03-output-2/suite.rc index a21f260e578..8074de1731c 100644 --- a/tests/cylc-reset/03-output-2/suite.rc +++ b/tests/cylc-reset/03-output-2/suite.rc @@ -1,10 +1,9 @@ [cylc] - UTC mode = True - [[events]] - abort on stalled = True - [[reference test]] - live mode suite timeout = PT1M - required run mode = live + UTC mode = True + [[events]] + abort on stalled = True + abort on inactivity = True + inactivity = PT3M [scheduling] [[graph]] R1 = t1 => t2 diff --git a/tests/cylc-scan/03-monitor.t b/tests/cylc-scan/03-monitor.t index 37a4f4bfc68..6e5574c2fca 100644 --- a/tests/cylc-scan/03-monitor.t +++ b/tests/cylc-scan/03-monitor.t @@ -16,7 +16,7 @@ # along with this program. If not, see . #------------------------------------------------------------------------------- # Test cylc monitor USER_AT_HOST interface, using cylc scan output. -. $(dirname $0)/test_header +. "$(dirname "$0")/test_header" #------------------------------------------------------------------------------- set_test_number 6 #------------------------------------------------------------------------------- @@ -33,6 +33,8 @@ run_ok "${TEST_NAME_BASE}-validate" cylc validate "${SUITE_NAME}" run_ok "${TEST_NAME_BASE}-run" cylc run "${SUITE_NAME}" TEST_NAME="${TEST_NAME_BASE}-monitor-1" +# Need fields from "cylc scan", cannot quote +# shellcheck disable=SC2046 run_ok "${TEST_NAME}" cylc monitor \ $(cylc scan --color=never -n "${SUITE_NAME}") --once grep_ok "${SUITE_NAME} - 1 task" "${TEST_NAME}.stdout" @@ -40,9 +42,12 @@ grep_ok "${SUITE_NAME} - 1 task" "${TEST_NAME}.stdout" # Same again, but force a port scan instead of looking under ~/cylc-run. # (This also tests GitHub #2795 -"cylc scan -a" abort). TEST_NAME="${TEST_NAME_BASE}-monitor-2" +# Need fields from "cylc scan", cannot quote +# shellcheck disable=SC2046 run_ok "${TEST_NAME}" cylc monitor \ $(cylc scan --color=never -n "${SUITE_NAME}") --once grep_ok "${SUITE_NAME} - 1 task" "${TEST_NAME}.stdout" -cylc stop --kill "${SUITE_NAME}" +cylc stop --kill --max-polls=20 --interval=1 "${SUITE_NAME}" purge_suite "${SUITE_NAME}" +exit diff --git a/tests/cylc-submit/11-multi.t b/tests/cylc-submit/11-multi.t index b1f1e78d82f..a21d00b70ec 100755 --- a/tests/cylc-submit/11-multi.t +++ b/tests/cylc-submit/11-multi.t @@ -53,6 +53,7 @@ for TASK_ID in 'food.2020' 'fool.2020' 'foot.2020' 'bar.2021'; do ST_FILE="${SUITE_RUN_DIR}/log/job/${POINT}/${NAME}/01/job.status" JOB_ID="$(awk -F= '$1 == "CYLC_BATCH_SYS_JOB_ID" {print $2}' "${ST_FILE}")" echo "[${TASK_ID}] Job ID: ${JOB_ID}" + poll ps "${JOB_ID}" 1>'/dev/null' 2>&1 done >'expected.out' contains_ok "${TEST_NAME_BASE}.stdout" 'expected.out' cmp_ok "${TEST_NAME_BASE}.stderr" <'/dev/null' diff --git a/tests/cylc-trigger/02-filter-failed/suite.rc b/tests/cylc-trigger/02-filter-failed/suite.rc index c59a64f574e..280eeb95bf5 100644 --- a/tests/cylc-trigger/02-filter-failed/suite.rc +++ b/tests/cylc-trigger/02-filter-failed/suite.rc @@ -2,8 +2,6 @@ UTC mode = True [[reference test]] expected task failures = fixable1.1, fixable2.1, fixable3.1 - live mode suite timeout = PT1M - required run mode = live [scheduling] [[graph]] R1 = """ diff --git a/tests/cylc-trigger/04-filter-names/suite.rc b/tests/cylc-trigger/04-filter-names/suite.rc index 1930da65e45..91f51cd6a46 100644 --- a/tests/cylc-trigger/04-filter-names/suite.rc +++ b/tests/cylc-trigger/04-filter-names/suite.rc @@ -2,8 +2,6 @@ UTC mode = True [[reference test]] expected task failures = fixable-1a.1, fixable-1b.1, fixable-2a.1, fixable-2b.1, fixable-3.1, loser.1 - live mode suite timeout = PT2M - required run mode = live [scheduling] [[graph]] R1 = """ diff --git a/tests/cylc-trigger/05-filter-cycles/suite.rc b/tests/cylc-trigger/05-filter-cycles/suite.rc index 88e797756c8..ac9fe0a3bfa 100644 --- a/tests/cylc-trigger/05-filter-cycles/suite.rc +++ b/tests/cylc-trigger/05-filter-cycles/suite.rc @@ -2,8 +2,6 @@ UTC mode = True [[reference test]] expected task failures = fixable.19700101T0000Z, fixable.19900101T0000Z, fixable.20100101T0000Z - live mode suite timeout = PT2M - required run mode = live [scheduling] initial cycle point = 1970 final cycle point = 2010 diff --git a/tests/cylc-trigger/06-reset-ready/suite.rc b/tests/cylc-trigger/06-reset-ready/suite.rc index 0b19cdb30d5..4b7eba4fc99 100644 --- a/tests/cylc-trigger/06-reset-ready/suite.rc +++ b/tests/cylc-trigger/06-reset-ready/suite.rc @@ -1,7 +1,5 @@ [cylc] [[reference test]] - required run mode = live - live mode suite timeout = PT1M expected task failures = t2.1 [scheduling] [[graph]] diff --git a/tests/database/03-remote/suite.rc b/tests/database/03-remote/suite.rc index cd84f46052c..b542416ed4a 100644 --- a/tests/database/03-remote/suite.rc +++ b/tests/database/03-remote/suite.rc @@ -1,7 +1,5 @@ [cylc] UTC mode = True - [[reference test]] - live mode suite timeout = PT1M [scheduling] initial cycle point=2020 final cycle point=2020 diff --git a/tests/database/04-lock-recover/suite.rc b/tests/database/04-lock-recover/suite.rc index 2506acdf776..8baf3ab7ad5 100644 --- a/tests/database/04-lock-recover/suite.rc +++ b/tests/database/04-lock-recover/suite.rc @@ -1,8 +1,5 @@ [cylc] UTC mode = True - [[reference test]] - required run mode = live - live mode suite timeout = PT2M [scheduling] [[graph]] R1 = """ diff --git a/tests/database/05-lock-recover-100/suite.rc b/tests/database/05-lock-recover-100/suite.rc index 537b18117b8..9ff6ae2eed0 100644 --- a/tests/database/05-lock-recover-100/suite.rc +++ b/tests/database/05-lock-recover-100/suite.rc @@ -1,8 +1,5 @@ [cylc] UTC mode = True - [[reference test]] - required run mode = live - live mode suite timeout = PT8M [scheduling] [[graph]] R1 = """ diff --git a/tests/database/06-task-message/suite.rc b/tests/database/06-task-message/suite.rc index 3fe87853653..c6af85eec5a 100644 --- a/tests/database/06-task-message/suite.rc +++ b/tests/database/06-task-message/suite.rc @@ -1,8 +1,5 @@ [cylc] UTC mode = True - [[reference test]] - required run mode = live - live mode suite timeout = PT30S [scheduling] [[graph]] R1 = t1 diff --git a/tests/directives/at/suite.rc b/tests/directives/at/suite.rc index fa352e404f4..4b433473c9d 100644 --- a/tests/directives/at/suite.rc +++ b/tests/directives/at/suite.rc @@ -1,7 +1,5 @@ [cylc] [[reference test]] - required run mode = live - live mode suite timeout = PT2.5M expected task failures = rem2.1 [scheduling] [[graph]] diff --git a/tests/directives/loadleveler/suite.rc b/tests/directives/loadleveler/suite.rc index 6c9ad16a024..0596f9ea1a8 100644 --- a/tests/directives/loadleveler/suite.rc +++ b/tests/directives/loadleveler/suite.rc @@ -3,8 +3,6 @@ {% set SITE_DIRECTIVES = environ['CYLC_TEST_BATCH_SITE_DIRECTIVES'] %} [cylc] [[reference test]] - required run mode = live - live mode suite timeout = PT2.5M expected task failures = rem2.1 [scheduling] [[graph]] diff --git a/tests/directives/pbs/suite.rc b/tests/directives/pbs/suite.rc index d7c7d3858f4..9126ede9ef4 100644 --- a/tests/directives/pbs/suite.rc +++ b/tests/directives/pbs/suite.rc @@ -3,8 +3,6 @@ {% set SITE_DIRECTIVES = environ['CYLC_TEST_BATCH_SITE_DIRECTIVES'] %} [cylc] [[reference test]] - required run mode = live - live mode suite timeout = PT3.5M expected task failures = rem2.1 [scheduling] [[graph]] diff --git a/tests/directives/slurm/suite.rc b/tests/directives/slurm/suite.rc index 69e04ed8834..acf3b0ca490 100644 --- a/tests/directives/slurm/suite.rc +++ b/tests/directives/slurm/suite.rc @@ -3,8 +3,6 @@ {% set SITE_DIRECTIVES = environ['CYLC_TEST_BATCH_SITE_DIRECTIVES'] %} [cylc] [[reference test]] - required run mode = live - live mode suite timeout = PT2.5M expected task failures = rem2.1 [scheduling] [[graph]] diff --git a/tests/events/04-timeout-ref-live.t b/tests/events/04-timeout-ref-live.t index 1f1aac159ed..c65cc21837f 100755 --- a/tests/events/04-timeout-ref-live.t +++ b/tests/events/04-timeout-ref-live.t @@ -28,6 +28,6 @@ run_ok $TEST_NAME cylc validate $SUITE_NAME TEST_NAME=$TEST_NAME_BASE-run RUN_MODE=$(basename $0 | sed "s/.*-ref-\(.*\).t/\1/g") suite_run_fail $TEST_NAME cylc run --reference-test --mode=$RUN_MODE --debug --no-detach $SUITE_NAME -grep_ok "WARNING - suite timed out after PT30S" "$TEST_NAME.stderr" +grep_ok "WARNING - suite timed out after PT1S" "$TEST_NAME.stderr" #------------------------------------------------------------------------------- purge_suite $SUITE_NAME diff --git a/tests/events/06-timeout-ref-simulation.t b/tests/events/06-timeout-ref-simulation.t index 3baf3e0d180..161e4e48567 100755 --- a/tests/events/06-timeout-ref-simulation.t +++ b/tests/events/06-timeout-ref-simulation.t @@ -28,6 +28,6 @@ run_ok $TEST_NAME cylc validate $SUITE_NAME TEST_NAME=$TEST_NAME_BASE-run RUN_MODE=$(basename $0 | sed "s/.*-ref-\(.*\).t/\1/g") suite_run_fail $TEST_NAME cylc run --reference-test --mode=$RUN_MODE --debug --no-detach $SUITE_NAME -grep_ok "WARNING - suite timed out after PT12S" "$TEST_NAME.stderr" +grep_ok "WARNING - suite timed out after PT1S" "$TEST_NAME.stderr" #------------------------------------------------------------------------------- purge_suite $SUITE_NAME diff --git a/tests/events/08-task-event-handler-retry/suite.rc b/tests/events/08-task-event-handler-retry/suite.rc index 4312235ea48..6e9cbccfafe 100644 --- a/tests/events/08-task-event-handler-retry/suite.rc +++ b/tests/events/08-task-event-handler-retry/suite.rc @@ -3,10 +3,6 @@ title=Task Event Handler Retry URL = http://my-suites.com/${CYLC_SUITE_NAME}.html -[cylc] - [[reference test]] - live mode suite timeout=PT1M - [scheduling] [[graph]] R1="t1 => t2" diff --git a/tests/events/09-task-event-mail/suite.rc b/tests/events/09-task-event-mail/suite.rc index fc3f39414d9..4f0db7d794f 100644 --- a/tests/events/09-task-event-mail/suite.rc +++ b/tests/events/09-task-event-mail/suite.rc @@ -7,8 +7,6 @@ [[events]] mail footer = see: http://localhost/stuff/%(owner)s/%(suite)s/ {% endif %}{# not GLOBALCFG is not defined #} - [[reference test]] - live mode suite timeout=PT1M [scheduling] [[graph]] diff --git a/tests/events/10-task-event-job-logs-retrieve/suite.rc b/tests/events/10-task-event-job-logs-retrieve/suite.rc index 1ed5b5d9562..c46da35d4ce 100644 --- a/tests/events/10-task-event-job-logs-retrieve/suite.rc +++ b/tests/events/10-task-event-job-logs-retrieve/suite.rc @@ -2,10 +2,6 @@ [meta] title=Task Event Job Log Retrieve -[cylc] - [[reference test]] - live mode suite timeout=PT1M - [scheduling] [[graph]] R1=t1 diff --git a/tests/events/11-cycle-task-event-job-logs-retrieve/suite.rc b/tests/events/11-cycle-task-event-job-logs-retrieve/suite.rc index 9c12057c15b..381c6de1e9e 100644 --- a/tests/events/11-cycle-task-event-job-logs-retrieve/suite.rc +++ b/tests/events/11-cycle-task-event-job-logs-retrieve/suite.rc @@ -5,8 +5,6 @@ [cylc] UTC mode = True cycle point format=%Y-%m-%dT%H:%MZ - [[reference test]] - live mode suite timeout=PT1M [scheduling] initial cycle point=2020-02-02T02:02Z diff --git a/tests/events/16-task-event-job-logs-register-globalcfg/suite.rc b/tests/events/16-task-event-job-logs-register-globalcfg/suite.rc index 247d95b9b56..8810fd080c8 100644 --- a/tests/events/16-task-event-job-logs-register-globalcfg/suite.rc +++ b/tests/events/16-task-event-job-logs-register-globalcfg/suite.rc @@ -2,10 +2,6 @@ [meta] title=Task Event Job Log Retrieve -[cylc] - [[reference test]] - live mode suite timeout=PT1M - [scheduling] [[graph]] R1=t1 diff --git a/tests/events/18-suite-event-mail/suite.rc b/tests/events/18-suite-event-mail/suite.rc index 17e34d0ef44..54eb45fe01c 100644 --- a/tests/events/18-suite-event-mail/suite.rc +++ b/tests/events/18-suite-event-mail/suite.rc @@ -9,8 +9,9 @@ mail footer = see: http://localhost/stuff/%(owner)s/%(suite)s/ mail smtp = {{MAIL_SMTP}} {% endif %}{# not GLOBALCFG is not defined #} - [[reference test]] - live mode suite timeout=PT1M + abort on stalled = True + abort on inactivity = True + inactivity = PT3M [scheduling] [[graph]] diff --git a/tests/events/20-suite-event-handlers/suite.rc b/tests/events/20-suite-event-handlers/suite.rc index 458a40c5cf3..2b520731359 100644 --- a/tests/events/20-suite-event-handlers/suite.rc +++ b/tests/events/20-suite-event-handlers/suite.rc @@ -10,8 +10,6 @@ handlers = echo 'Your %(suite)s suite has a %(event)s event and URL %(suite_url)s and suite-priority as %(suite-priority)s and suite-UUID as %(suite_uuid)s.' handler events = startup {% endif %}{# not GLOBALCFG is not defined #} - [[reference test]] - live mode suite timeout=PT1M [scheduling] [[graph]] diff --git a/tests/events/23-suite-stalled-handler/suite.rc b/tests/events/23-suite-stalled-handler/suite.rc index 8c06f07a813..82505ee29f2 100644 --- a/tests/events/23-suite-stalled-handler/suite.rc +++ b/tests/events/23-suite-stalled-handler/suite.rc @@ -3,8 +3,7 @@ [[events]] stalled handler = cylc reset %(suite)s bar -s succeeded [[reference test]] - allow task failures = true - live mode suite timeout=PT1M + expected task failures = bar.1 [scheduling] [[graph]] R1 = foo => bar => baz diff --git a/tests/events/24-abort-on-stalled/suite.rc b/tests/events/24-abort-on-stalled/suite.rc index 5c7ecb7543a..21bbffd5d38 100644 --- a/tests/events/24-abort-on-stalled/suite.rc +++ b/tests/events/24-abort-on-stalled/suite.rc @@ -3,8 +3,7 @@ [[events]] abort on stalled = true [[reference test]] - allow task failures = true - live mode suite timeout=PT1M + expected task failures = bar.1 [scheduling] [[graph]] R1 = foo => bar => baz diff --git a/tests/events/26-suite-stalled-dump-prereq/suite.rc b/tests/events/26-suite-stalled-dump-prereq/suite.rc index aa5652bf974..c64c1a0d95a 100644 --- a/tests/events/26-suite-stalled-dump-prereq/suite.rc +++ b/tests/events/26-suite-stalled-dump-prereq/suite.rc @@ -3,8 +3,7 @@ [[events]] abort on stalled = true [[reference test]] - allow task failures = true - live mode suite timeout=PT1M + expected task failures = bar.20100101T0000Z [scheduling] initial cycle point = 20100101T0000Z [[graph]] diff --git a/tests/events/27-suite-stalled-dump-prereq-fam/suite.rc b/tests/events/27-suite-stalled-dump-prereq-fam/suite.rc index 17591502d0c..f27cffbfb6d 100644 --- a/tests/events/27-suite-stalled-dump-prereq-fam/suite.rc +++ b/tests/events/27-suite-stalled-dump-prereq-fam/suite.rc @@ -3,8 +3,7 @@ [[events]] abort on stalled = true [[reference test]] - allow task failures = true - live mode suite timeout=PT1M + expected task failures = foo.1 [scheduling] [[graph]] R1 = """foo => FAM diff --git a/tests/events/28-inactivity/suite.rc b/tests/events/28-inactivity/suite.rc index 5a6e8b9740d..7273ea62c5a 100644 --- a/tests/events/28-inactivity/suite.rc +++ b/tests/events/28-inactivity/suite.rc @@ -4,8 +4,6 @@ inactivity = PT10S abort on inactivity = True abort on timeout = True - [[reference test]] - live mode suite timeout=PT1M [scheduling] [[graph]] diff --git a/tests/events/29-task-event-mail-1/suite.rc b/tests/events/29-task-event-mail-1/suite.rc index 401b128e8ae..db6ea2bea11 100644 --- a/tests/events/29-task-event-mail-1/suite.rc +++ b/tests/events/29-task-event-mail-1/suite.rc @@ -5,8 +5,6 @@ [cylc] [[events]] mail footer = see: http://localhost/stuff/%(owner)s/%(suite)s/ - [[reference test]] - live mode suite timeout=PT1M [scheduling] [[graph]] diff --git a/tests/events/30-task-event-mail-2/suite.rc b/tests/events/30-task-event-mail-2/suite.rc index 29f880c8054..ef9ed240f16 100644 --- a/tests/events/30-task-event-mail-2/suite.rc +++ b/tests/events/30-task-event-mail-2/suite.rc @@ -10,7 +10,6 @@ timeout = PT20S [[reference test]] expected task failures = t1.1, t2.1, t3.1, t4.1, t5.1 - live mode suite timeout=PT3M [scheduling] [[graph]] diff --git a/tests/events/32-task-event-job-logs-retrieve-2/suite.rc b/tests/events/32-task-event-job-logs-retrieve-2/suite.rc index be53380c390..a3c46963724 100644 --- a/tests/events/32-task-event-job-logs-retrieve-2/suite.rc +++ b/tests/events/32-task-event-job-logs-retrieve-2/suite.rc @@ -2,10 +2,6 @@ [meta] title=Task Event Job Log Retrieve 1 -[cylc] - [[reference test]] - live mode suite timeout=PT1M - [scheduling] [[graph]] R1=t1 diff --git a/tests/events/33-task-event-job-logs-retrieve-3/suite.rc b/tests/events/33-task-event-job-logs-retrieve-3/suite.rc index d607fb52dbf..dc253639435 100644 --- a/tests/events/33-task-event-job-logs-retrieve-3/suite.rc +++ b/tests/events/33-task-event-job-logs-retrieve-3/suite.rc @@ -7,7 +7,6 @@ abort on timeout = True timeout = PT1M [[reference test]] - live mode suite timeout=PT1M expected task failures = t1.1 [scheduling] diff --git a/tests/events/34-task-abort.t b/tests/events/34-task-abort.t index ab2441d8c7b..6907196790c 100755 --- a/tests/events/34-task-abort.t +++ b/tests/events/34-task-abort.t @@ -16,22 +16,19 @@ # along with this program. If not, see . #------------------------------------------------------------------------------- # Test job abort-with-message and interaction with failed handler. -. $(dirname $0)/test_header -#------------------------------------------------------------------------------- +. "$(dirname "$0")/test_header" set_test_number 5 +install_suite "${TEST_NAME_BASE}" "${TEST_NAME_BASE}" #------------------------------------------------------------------------------- -install_suite $TEST_NAME_BASE $TEST_NAME_BASE -#------------------------------------------------------------------------------- -TEST_NAME=$TEST_NAME_BASE-validate -run_ok $TEST_NAME cylc validate $SUITE_NAME +run_ok "${TEST_NAME_BASE}-validate" cylc validate "${SUITE_NAME}" #------------------------------------------------------------------------------- -TEST_NAME=$TEST_NAME_BASE-run -suite_run_ok $TEST_NAME cylc run --no-detach --debug --no-detach $SUITE_NAME +suite_run_ok "${TEST_NAME_BASE}-run" \ + cylc run --reference-test --debug --no-detach "${SUITE_NAME}" #------------------------------------------------------------------------------- # Check failed handler only call on last try. LOG="${SUITE_RUN_DIR}/log/job/1/foo/NN/job-activity.log" grep "event-handler" "${LOG}" > 'edited-job-activity.log' -cmp_ok 'edited-job-activity.log' <<__LOG__ +cmp_ok 'edited-job-activity.log' <<'__LOG__' [(('event-handler-00', 'failed'), 2) cmd] echo "!!!FAILED!!!" failed foo.1 2 '"ERROR: rust never sleeps"' [(('event-handler-00', 'failed'), 2) ret_code] 0 [(('event-handler-00', 'failed'), 2) out] !!!FAILED!!! failed foo.1 2 "ERROR: rust never sleeps" @@ -40,10 +37,9 @@ __LOG__ # Check job stdout stops at the abort call. LOG="${SUITE_RUN_DIR}/log/job/1/foo/NN/job.out" # ...before abort -TEST_NAME=${TEST_NAME_BASE}-stdout1 -run_ok $TEST_NAME grep ONE "${LOG}" +grep_ok 'ONE' "${LOG}" # ...after abort -TEST_NAME=${TEST_NAME_BASE}-stdout2 -run_fail $TEST_NAME grep TWO "${LOG}" +grep_fail 'TWO' "${LOG}" #------------------------------------------------------------------------------- purge_suite "${SUITE_NAME}" +exit diff --git a/tests/events/34-task-abort/reference.log b/tests/events/34-task-abort/reference.log new file mode 100644 index 00000000000..6d6f9e23729 --- /dev/null +++ b/tests/events/34-task-abort/reference.log @@ -0,0 +1,3 @@ +Initial point: 1 +Final point: 1 +[foo.1] -triggered off [] diff --git a/tests/events/34-task-abort/suite.rc b/tests/events/34-task-abort/suite.rc index 8a9c9104842..7d9374741ce 100644 --- a/tests/events/34-task-abort/suite.rc +++ b/tests/events/34-task-abort/suite.rc @@ -1,9 +1,8 @@ [meta] title = "Test job abort with retries and failed handler" [cylc] - [[events]] - inactivity = PT20S - abort on inactivity = True + [[reference test]] + expected task failures = foo.1 [scheduling] [[graph]] R1 = "foo:fail => !foo" @@ -14,6 +13,6 @@ echo ONE cylc__job_abort "ERROR: rust never sleeps" echo TWO""" [[[job]]] - execution retry delays = PT5S + execution retry delays = PT0S [[[events]]] failed handler = echo "!!!FAILED!!!" %(event)s %(id)s %(submit_num)s %(message)s diff --git a/tests/events/36-task-event-bad-custom-template/suite.rc b/tests/events/36-task-event-bad-custom-template/suite.rc index 99d86bb337d..467f52763a5 100644 --- a/tests/events/36-task-event-bad-custom-template/suite.rc +++ b/tests/events/36-task-event-bad-custom-template/suite.rc @@ -1,8 +1,4 @@ #!jinja2 -[cylc] - [[reference test]] - live mode suite timeout=PT1M - [scheduling] [[graph]] R1=t1 diff --git a/tests/events/37-suite-event-bad-custom-template/suite.rc b/tests/events/37-suite-event-bad-custom-template/suite.rc index 5917efcbe96..42c3c6b7cde 100644 --- a/tests/events/37-suite-event-bad-custom-template/suite.rc +++ b/tests/events/37-suite-event-bad-custom-template/suite.rc @@ -6,8 +6,6 @@ {% if ABORT is defined %} abort if startup handler fails = True {% endif %} - [[reference test]] - live mode suite timeout=PT1M [scheduling] [[graph]] diff --git a/tests/events/38-task-event-handler-custom/suite.rc b/tests/events/38-task-event-handler-custom/suite.rc index d26a52aaab4..516651ca0d7 100644 --- a/tests/events/38-task-event-handler-custom/suite.rc +++ b/tests/events/38-task-event-handler-custom/suite.rc @@ -1,7 +1,3 @@ -[cylc] - [[reference test]] - required run mode = live - live mode suite timeout = PT30S [scheduling] [[graph]] R1 = """foo:a => bar diff --git a/tests/events/44-timeout.t b/tests/events/44-timeout.t index 2398e3aa261..c9114737fe2 100755 --- a/tests/events/44-timeout.t +++ b/tests/events/44-timeout.t @@ -32,21 +32,21 @@ run_ok "${TEST_NAME_BASE}-validate" cylc validate "${SUITE_NAME}" suite_run_ok "${TEST_NAME_BASE}-run" \ cylc run --debug --no-detach "${SUITE_NAME}" -cylc cat-log "${SUITE_NAME}" | \ - grep -A 3 ERROR | sed -e 's/^.* \([EW]\)/\1/' > log +sed -e 's/^.* \([EW]\)/\1/' "${SUITE_RUN_DIR}/log/suite/log" >'log' -cmp_ok log <<__END__ +contains_ok 'log' <<__END__ ERROR - [(('event-handler-00', 'started'), 1) cmd] sleeper.sh foo.1 [(('event-handler-00', 'started'), 1) ret_code] -9 [(('event-handler-00', 'started'), 1) err] killed on timeout (PT10S) WARNING - 1/foo/01 ('event-handler-00', 'started') failed __END__ -cylc suite-state "${SUITE_NAME}" > suite-state.log +cylc suite-state "${SUITE_NAME}" >'suite-state.log' -contains_ok suite-state.log << __END__ +contains_ok 'suite-state.log' << __END__ stopper, 1, succeeded foo, 1, succeeded __END__ purge_suite "${SUITE_NAME}" +exit diff --git a/tests/events/47-long-output.t b/tests/events/47-long-output.t index 73da8d87c96..d6ea4ad3304 100755 --- a/tests/events/47-long-output.t +++ b/tests/events/47-long-output.t @@ -30,7 +30,6 @@ process pool timeout = PT10S" "" # Long STDOUT output init_suite "${TEST_NAME_BASE}" <<__SUITERC__ -[cylc] [scheduling] [[graph]] R1 = t1 @@ -40,11 +39,16 @@ init_suite "${TEST_NAME_BASE}" <<__SUITERC__ [[[events]]] succeeded handler = cat "${CYLC_REPO_DIR}/COPYING" "${CYLC_REPO_DIR}/COPYING" "${CYLC_REPO_DIR}/COPYING" && echo __SUITERC__ +cat >'reference.log' <<'__REFLOG__' +Initial point: 1 +Final point: 1 +[t1.1] -triggered off [] +__REFLOG__ run_ok "${TEST_NAME_BASE}-validate" cylc validate "${SUITE_NAME}" suite_run_ok "${TEST_NAME_BASE}-run" \ - cylc run --debug --no-detach "${SUITE_NAME}" + cylc run --debug --no-detach --reference-test "${SUITE_NAME}" cylc cat-log "${SUITE_NAME}" >'log' sed -n 's/^.*\(GNU GENERAL PUBLIC LICENSE\)/\1/p' 'log' >'log-1' @@ -63,7 +67,6 @@ purge_suite "${SUITE_NAME}" # REPEAT: Long STDERR output init_suite "${TEST_NAME_BASE}" <<__SUITERC__ -[cylc] [scheduling] [[graph]] R1 = t1 @@ -73,11 +76,16 @@ init_suite "${TEST_NAME_BASE}" <<__SUITERC__ [[[events]]] succeeded handler = cat "${CYLC_REPO_DIR}/COPYING" "${CYLC_REPO_DIR}/COPYING" "${CYLC_REPO_DIR}/COPYING" >&2 && echo __SUITERC__ +cat >'reference.log' <<'__REFLOG__' +Initial point: 1 +Final point: 1 +[t1.1] -triggered off [] +__REFLOG__ run_ok "${TEST_NAME_BASE}-validate" cylc validate "${SUITE_NAME}" suite_run_ok "${TEST_NAME_BASE}-run" \ - cylc run --debug --no-detach "${SUITE_NAME}" + cylc run --debug --no-detach --reference-test "${SUITE_NAME}" cylc cat-log "${SUITE_NAME}" >'log' sed -n 's/^.*\(GNU GENERAL PUBLIC LICENSE\)/\1/p' 'log' >'log-1' diff --git a/tests/events/48-suite-aborted/suite.rc b/tests/events/48-suite-aborted/suite.rc index 08c020eba1b..b4cf12e3315 100644 --- a/tests/events/48-suite-aborted/suite.rc +++ b/tests/events/48-suite-aborted/suite.rc @@ -6,8 +6,6 @@ abort on timeout = true timeout = PT1M aborted handler = echo %(event)s %(message)s >"${CYLC_SUITE_RUN_DIR}/handler.out" - [[reference test]] - live mode suite timeout=PT1M [scheduling] [[graph]] R1 = modify => t2 diff --git a/flakytests/restart/04-running/bin/ctb-select-task-states b/tests/events/50-ref-test-fail.t similarity index 56% rename from flakytests/restart/04-running/bin/ctb-select-task-states rename to tests/events/50-ref-test-fail.t index 3dc474171ea..353ee41f21a 100755 --- a/flakytests/restart/04-running/bin/ctb-select-task-states +++ b/tests/events/50-ref-test-fail.t @@ -1,7 +1,7 @@ #!/bin/bash # THIS FILE IS PART OF THE CYLC SUITE ENGINE. # Copyright (C) 2008-2019 NIWA & British Crown (Met Office) & Contributors. -# +# # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or @@ -15,28 +15,24 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . #------------------------------------------------------------------------------- -set -eu -CYLC_SUITE_RUN_DIR="$1" -CYLC_TASK_NAME="${2:-}" -sqlite3 "${CYLC_SUITE_RUN_DIR}/log/db" " -SELECT - task_states.name, - task_states.cycle, - task_states.submit_num, - task_jobs.try_num, - task_states.status -FROM - task_states -LEFT OUTER JOIN - task_jobs -ON - task_states.name == task_jobs.name -AND - task_states.cycle == task_jobs.cycle -AND - task_states.submit_num == task_jobs.submit_num -WHERE - task_states.name != '${CYLC_TASK_NAME}' -ORDER BY - task_states.name, task_states.cycle -;" +# Test output of reference test failure. +. "$(dirname "$0")/test_header" +set_test_number 4 + +install_suite "${TEST_NAME_BASE}" "${TEST_NAME_BASE}" +run_ok "${TEST_NAME_BASE}-validate" cylc validate "${SUITE_NAME}" +suite_run_fail "${TEST_NAME_BASE}-run" \ + cylc run --debug --no-detach --reference-test "${SUITE_NAME}" +LOG="${SUITE_RUN_DIR}/log/suite/log" +grep_ok 'SUITE REFERENCE TEST FAILED' "${LOG}" +contains_ok "${LOG}" <<'__LOG__' + triggering is NOT consistent with the reference log: + --- reference + +++ this run + @@ -1 +1,2 @@ + [t2.1] -triggered off ['t1.1'] + +[t3.1] -triggered off ['t2.1'] +__LOG__ + +purge_suite "${SUITE_NAME}" +exit diff --git a/tests/events/50-ref-test-fail/reference.log b/tests/events/50-ref-test-fail/reference.log new file mode 100644 index 00000000000..00b3bf2ae38 --- /dev/null +++ b/tests/events/50-ref-test-fail/reference.log @@ -0,0 +1,4 @@ +2016-05-23T12:58:33Z INFO - Initial point: 1 +2016-05-23T12:58:33Z INFO - Final point: 1 +2016-05-23T12:58:33Z INFO - [t1.1] -triggered off [] +2016-05-23T12:58:33Z INFO - [t2.1] -triggered off ['t1.1'] diff --git a/tests/events/50-ref-test-fail/suite.rc b/tests/events/50-ref-test-fail/suite.rc new file mode 100644 index 00000000000..3f313b16bd3 --- /dev/null +++ b/tests/events/50-ref-test-fail/suite.rc @@ -0,0 +1,6 @@ +[scheduling] + [[graph]] + R1 = t1 => t2 => t3 +[runtime] + [[t1, t2, t3]] + script = true diff --git a/tests/events/suite/suite.rc b/tests/events/suite/suite.rc index 5a344cbffbd..34017e3577b 100644 --- a/tests/events/suite/suite.rc +++ b/tests/events/suite/suite.rc @@ -1,6 +1,3 @@ -[cylc] - [[reference test]] - live mode suite timeout = PT1M [scheduling] [[graph]] R1 = "startup => timeout => shutdown" diff --git a/tests/events/timeout-ref/suite.rc b/tests/events/timeout-ref/suite.rc index 7a71f8cd031..b969f1f3400 100644 --- a/tests/events/timeout-ref/suite.rc +++ b/tests/events/timeout-ref/suite.rc @@ -2,10 +2,9 @@ description = This suite is supposed to time out [cylc] - [[reference test]] - live mode suite timeout = PT0.5M - dummy mode suite timeout = PT6S - simulation mode suite timeout = PT12S + [[events]] + abort on timeout = True + timeout = PT1S [scheduling] [[graph]] diff --git a/tests/execution-time-limit/02-slurm/suite.rc b/tests/execution-time-limit/02-slurm/suite.rc index 239b86e5450..d38a7f58120 100644 --- a/tests/execution-time-limit/02-slurm/suite.rc +++ b/tests/execution-time-limit/02-slurm/suite.rc @@ -1,9 +1,4 @@ #!jinja2 -[cylc] - [[reference test]] - required run mode = live - live mode suite timeout = PT5M - [scheduling] [[graph]] R1 = foo diff --git a/tests/ext-trigger/00-satellite/suite.rc b/tests/ext-trigger/00-satellite/suite.rc index 5d5d2cbf272..18eaf4d3251 100644 --- a/tests/ext-trigger/00-satellite/suite.rc +++ b/tests/ext-trigger/00-satellite/suite.rc @@ -27,9 +27,6 @@ [cylc] UTC mode = True - [[reference test]] - required run mode = live - live mode suite timeout = PT2M [scheduling] cycling mode = integer diff --git a/tests/graph-equivalence/multiline_and1/suite.rc b/tests/graph-equivalence/multiline_and1/suite.rc index 410e20a632a..f59d6f025d9 100644 --- a/tests/graph-equivalence/multiline_and1/suite.rc +++ b/tests/graph-equivalence/multiline_and1/suite.rc @@ -1,7 +1,3 @@ -[cylc] - [[reference test]] - required run mode = live - live mode suite timeout = PT30S [scheduling] [[graph]] R1 = "a & b => c" diff --git a/tests/graph-equivalence/multiline_and2/suite.rc b/tests/graph-equivalence/multiline_and2/suite.rc index 8fe51929464..51440fa36e4 100644 --- a/tests/graph-equivalence/multiline_and2/suite.rc +++ b/tests/graph-equivalence/multiline_and2/suite.rc @@ -1,7 +1,3 @@ -[cylc] - [[reference test]] - required run mode = live - live mode suite timeout = PT30S [scheduling] [[graph]] R1 = """a => c diff --git a/tests/graph-equivalence/test1/suite.rc b/tests/graph-equivalence/test1/suite.rc index 427ad459944..60e11e860d3 100644 --- a/tests/graph-equivalence/test1/suite.rc +++ b/tests/graph-equivalence/test1/suite.rc @@ -1,7 +1,3 @@ -[cylc] - [[reference test]] - required run mode = live - live mode suite timeout = PT30S [scheduling] [[graph]] R1 = "a => b => c" diff --git a/tests/graph-equivalence/test2/suite.rc b/tests/graph-equivalence/test2/suite.rc index 88135c6d420..2b1b0e5869f 100644 --- a/tests/graph-equivalence/test2/suite.rc +++ b/tests/graph-equivalence/test2/suite.rc @@ -1,7 +1,3 @@ -[cylc] - [[reference test]] - required run mode = live - live mode suite timeout = PT30S [scheduling] [[graph]] R1 = """a => b diff --git a/tests/graph-equivalence/test3/suite.rc b/tests/graph-equivalence/test3/suite.rc index 75a99c17bcc..ca0874d9f9c 100644 --- a/tests/graph-equivalence/test3/suite.rc +++ b/tests/graph-equivalence/test3/suite.rc @@ -1,7 +1,3 @@ -[cylc] - [[reference test]] - required run mode = live - live mode suite timeout = PT30S [scheduling] [[graph]] R1 = """a => b \ diff --git a/tests/graphql/01-workflow.t b/tests/graphql/01-workflow.t index 4866b65bdcc..8f911a4c57f 100755 --- a/tests/graphql/01-workflow.t +++ b/tests/graphql/01-workflow.t @@ -16,7 +16,7 @@ # along with this program. If not, see . #------------------------------------------------------------------------------- # Test suite graphql interface -. $(dirname $0)/test_header +. "$(dirname "$0")/test_header" #------------------------------------------------------------------------------- set_test_number 4 #------------------------------------------------------------------------------- @@ -75,7 +75,7 @@ SUITE_LOG_DIR="$( cylc cat-log -m p "${SUITE_NAME}" \ | xargs dirname )" # stop suite -cylc stop "${SUITE_NAME}" --kill +cylc stop --max-polls=10 --interval=2 --kill "${SUITE_NAME}" # compare to expectation cat > expected << __HERE__ diff --git a/tests/graphql/02-root-queries.t b/tests/graphql/02-root-queries.t index 3fd2f1eb7f2..e5d619b7212 100755 --- a/tests/graphql/02-root-queries.t +++ b/tests/graphql/02-root-queries.t @@ -16,7 +16,7 @@ # along with this program. If not, see . #------------------------------------------------------------------------------- # Test suite graphql interface -. $(dirname $0)/test_header +. "$(dirname "$0")/test_header" #------------------------------------------------------------------------------- set_test_number 4 #------------------------------------------------------------------------------- @@ -79,7 +79,7 @@ TEST_NAME="${TEST_NAME_BASE}-contact" run_ok "${TEST_NAME_BASE}-contact" cylc get-contact "${SUITE_NAME}" # stop suite -cylc stop --kill "${SUITE_NAME}" +cylc stop --max-polls=10 --interval=2 --kill "${SUITE_NAME}" # compare to expectation cat > expected << __HERE__ diff --git a/tests/hold-release/11-retrying/suite.rc b/tests/hold-release/11-retrying/suite.rc index 246addbc5a4..3e4237c75b3 100644 --- a/tests/hold-release/11-retrying/suite.rc +++ b/tests/hold-release/11-retrying/suite.rc @@ -1,12 +1,6 @@ [meta] title = Test task retry - hold - release -[cylc] - [[reference test]] - live mode suite timeout = PT1M30S - dummy mode suite timeout = PT1M30S - simulation mode suite timeout = PT1M30S - [scheduling] [[graph]] R1 = """ diff --git a/tests/hold-release/12-hold-then-retry/suite.rc b/tests/hold-release/12-hold-then-retry/suite.rc index 89f5c22162b..81db695be82 100644 --- a/tests/hold-release/12-hold-then-retry/suite.rc +++ b/tests/hold-release/12-hold-then-retry/suite.rc @@ -2,10 +2,10 @@ title = Test: run task - hold suite - task job retry - release suite [cylc] - [[reference test]] - live mode suite timeout = PT1M30S - dummy mode suite timeout = PT1M30S - simulation mode suite timeout = PT1M30S + [[events]] + abort on stalled = True + abort on inactivity = True + inactivity = PT3M [scheduling] [[graph]] diff --git a/tests/hold-release/18-hold-cycle-globs/suite.rc b/tests/hold-release/18-hold-cycle-globs/suite.rc index 8f5eaa224a6..70dcbd8a76c 100644 --- a/tests/hold-release/18-hold-cycle-globs/suite.rc +++ b/tests/hold-release/18-hold-cycle-globs/suite.rc @@ -1,8 +1,5 @@ [cylc] UTC mode = True - [[reference test]] - live mode suite timeout = PT1M - required run mode = live [scheduling] initial cycle point = 1990 final cycle point = 2030 diff --git a/tests/hold-release/19-no-reset-prereq-on-waiting/suite.rc b/tests/hold-release/19-no-reset-prereq-on-waiting/suite.rc index 63ea40e4de7..33757251482 100644 --- a/tests/hold-release/19-no-reset-prereq-on-waiting/suite.rc +++ b/tests/hold-release/19-no-reset-prereq-on-waiting/suite.rc @@ -4,9 +4,6 @@ UTC mode = True [[events]] abort on stalled = True - [[reference test]] - live mode suite timeout = PT30S - required run mode = live [scheduling] initial cycle point = 2016 final cycle point = 2016 diff --git a/tests/hold-release/beyond-stop/suite.rc b/tests/hold-release/beyond-stop/suite.rc index b549d90aec3..6ae9d287bb1 100644 --- a/tests/hold-release/beyond-stop/suite.rc +++ b/tests/hold-release/beyond-stop/suite.rc @@ -9,8 +9,6 @@ beyond the suite stop point.""" [cylc] cycle point format = %Y%m%dT%H - [[reference test]] - live mode suite timeout = PT30S [scheduling] initial cycle point = 20140101T00 diff --git a/tests/hold-release/hold-after-point/suite.rc b/tests/hold-release/hold-after-point/suite.rc index 3fcb793d7ab..58b827a5f15 100644 --- a/tests/hold-release/hold-after-point/suite.rc +++ b/tests/hold-release/hold-after-point/suite.rc @@ -5,8 +5,6 @@ [cylc] UTC mode = True - [[reference test]] - live mode suite timeout = PT1M [scheduling] initial cycle point = 20100101T00Z diff --git a/tests/hold-release/hold-family/suite.rc b/tests/hold-release/hold-family/suite.rc index fab10d753cc..96ba127e67b 100644 --- a/tests/hold-release/hold-family/suite.rc +++ b/tests/hold-release/hold-family/suite.rc @@ -7,8 +7,6 @@ point of the suite.""" [cylc] UTC mode = True - [[reference test]] - live mode suite timeout = PT1M [scheduling] initial cycle point = 20141009T00 [[graph]] diff --git a/tests/hold-release/hold-on-spawn/suite.rc b/tests/hold-release/hold-on-spawn/suite.rc index 6e92b7a3891..f78b3b979f3 100644 --- a/tests/hold-release/hold-on-spawn/suite.rc +++ b/tests/hold-release/hold-on-spawn/suite.rc @@ -6,8 +6,6 @@ [cylc] UTC mode = True - [[reference test]] - live mode suite timeout = PT1M [scheduling] initial cycle point = 20141009T00 [[graph]] diff --git a/tests/hold-release/hold-task/suite.rc b/tests/hold-release/hold-task/suite.rc index 1ed0b0450c7..8c7af7753c0 100644 --- a/tests/hold-release/hold-task/suite.rc +++ b/tests/hold-release/hold-task/suite.rc @@ -7,8 +7,6 @@ point of the suite.""" [cylc] UTC mode = True - [[reference test]] - live mode suite timeout = PT1M [scheduling] initial cycle point = 20141009T00 [[graph]] diff --git a/tests/hold-release/release-family/suite.rc b/tests/hold-release/release-family/suite.rc index 0bde7298fad..59012eccc28 100644 --- a/tests/hold-release/release-family/suite.rc +++ b/tests/hold-release/release-family/suite.rc @@ -7,8 +7,6 @@ first cycle point of the suite..""" [cylc] UTC mode = True - [[reference test]] - live mode suite timeout = PT1M [scheduling] initial cycle point = 20141009T00 [[graph]] diff --git a/tests/hold-release/release-task/suite.rc b/tests/hold-release/release-task/suite.rc index e070aad1dee..3085f6e4351 100644 --- a/tests/hold-release/release-task/suite.rc +++ b/tests/hold-release/release-task/suite.rc @@ -7,8 +7,6 @@ first cycle point of the suite.""" [cylc] UTC mode = True - [[reference test]] - live mode suite timeout = PT1M [scheduling] initial cycle point = 20141009T00 [[graph]] diff --git a/tests/hold-release/run-hold-after/suite.rc b/tests/hold-release/run-hold-after/suite.rc index 84dc761f7c9..6ce42edac0c 100644 --- a/tests/hold-release/run-hold-after/suite.rc +++ b/tests/hold-release/run-hold-after/suite.rc @@ -5,8 +5,6 @@ [cylc] UTC mode = True - [[reference test]] - live mode suite timeout = PT1M [scheduling] initial cycle point = 20140101T00 diff --git a/tests/hold-release/suite/suite.rc b/tests/hold-release/suite/suite.rc index 985876e62d6..25ce938a23b 100644 --- a/tests/hold-release/suite/suite.rc +++ b/tests/hold-release/suite/suite.rc @@ -10,8 +10,6 @@ [cylc] cycle point format = %Y%m%dT%H - [[reference test]] - live mode suite timeout = PT30S [scheduling] initial cycle point = 20140101T00 diff --git a/tests/host-select/00-simple/bin/cleanup.sh b/tests/host-select/00-simple/bin/cleanup.sh deleted file mode 100755 index 77fc59aa8d6..00000000000 --- a/tests/host-select/00-simple/bin/cleanup.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -# remove installed remote passphrase -set -e -cylc check-triggering "$@" -if [[ $CYLC_TEST_OWNER@$CYLC_TEST_HOST == $USER@localhost || \ - $CYLC_TEST_OWNER@$CYLC_TEST_HOST == $USER@$(hostname) ]]; then - exit -fi -echo "Done" diff --git a/tests/host-select/00-simple/suite.rc b/tests/host-select/00-simple/suite.rc index a4f55c17ea1..5534e9e0709 100644 --- a/tests/host-select/00-simple/suite.rc +++ b/tests/host-select/00-simple/suite.rc @@ -10,10 +10,6 @@ Task host is determined by a script in the suite bin directory; for this test suite it just returns the value of $CYLC_TEST_HOST as used by many of the other test suites (see "cylc test-battery --help").""" -[cylc] - [[reference test]] - live mode suite timeout = PT30S - suite shutdown event handler = cleanup.sh [scheduling] [[graph]] R1 = "foo1 & foo2 & foo3 & bar" diff --git a/tests/host-select/01-timeout/suite.rc b/tests/host-select/01-timeout/suite.rc index e38cd075579..3b257883d5e 100644 --- a/tests/host-select/01-timeout/suite.rc +++ b/tests/host-select/01-timeout/suite.rc @@ -4,8 +4,6 @@ [cylc] [[reference test]] - required run mode = live - live mode suite timeout = PT10S expected task failures = foo.1 [scheduling] [[graph]] diff --git a/tests/intercycle/future/suite.rc b/tests/intercycle/future/suite.rc index 990a25ba2e4..5a9943fe0a9 100644 --- a/tests/intercycle/future/suite.rc +++ b/tests/intercycle/future/suite.rc @@ -1,9 +1,5 @@ - [cylc] cycle point format = %Y%m%dT%H - [[reference test]] - required run mode = live - live mode suite timeout = PT1M [scheduling] initial cycle point = 20120101T00 diff --git a/tests/intercycle/past/suite.rc b/tests/intercycle/past/suite.rc index 5e7f73ef536..0eb487e2f40 100644 --- a/tests/intercycle/past/suite.rc +++ b/tests/intercycle/past/suite.rc @@ -6,8 +6,6 @@ Task A should only run at 0, 12 hours; Task B at 6, 18""" [cylc] UTC mode = True - [[reference test]] - live mode suite timeout = PT1M [scheduling] initial cycle point = 20120101T00 diff --git a/tests/jinja2/commandline-set/suite.rc b/tests/jinja2/commandline-set/suite.rc index f1e8f1d9f1b..893ec89748f 100644 --- a/tests/jinja2/commandline-set/suite.rc +++ b/tests/jinja2/commandline-set/suite.rc @@ -7,9 +7,6 @@ to pass the test run their values must be 'foo' and '2', respectively.""" [cylc] UTC mode = True - [[reference test]] - required run mode = live - live mode suite timeout = PT30S [scheduling] initial cycle point = 2010 diff --git a/tests/job-file-trap/01-loadleveler/suite.rc b/tests/job-file-trap/01-loadleveler/suite.rc index 3b7e4c6492f..bfef9ec0965 100644 --- a/tests/job-file-trap/01-loadleveler/suite.rc +++ b/tests/job-file-trap/01-loadleveler/suite.rc @@ -1,9 +1,4 @@ #!jinja2 -[cylc] - [[reference test]] - required run mode=live - live mode suite timeout=PT5M # minutes - [scheduling] [[graph]] R1=""" diff --git a/tests/job-file-trap/02-pipefail/suite.rc b/tests/job-file-trap/02-pipefail/suite.rc index 6a426a89532..31036a7b42e 100644 --- a/tests/job-file-trap/02-pipefail/suite.rc +++ b/tests/job-file-trap/02-pipefail/suite.rc @@ -1,9 +1,8 @@ #!jinja2 [cylc] - abort if any task fails = True + [[events]] + abort if any task fails = True [[reference test]] - required run mode = live - live mode suite timeout = PT10S expected task failures = t1.1 [scheduling] diff --git a/tests/job-kill/00-local/suite.rc b/tests/job-kill/00-local/suite.rc index 997c7364b2a..0b981b536d9 100644 --- a/tests/job-kill/00-local/suite.rc +++ b/tests/job-kill/00-local/suite.rc @@ -1,9 +1,7 @@ #!Jinja2 [cylc] [[reference test]] - required run mode=live expected task failures = t1.1, t2.1, t3.1, t4.1, stop2.1 - live mode suite timeout = PT1M [scheduling] [[graph]] R1=""" diff --git a/tests/job-kill/01-remote/suite.rc b/tests/job-kill/01-remote/suite.rc index 06310e5863f..8e496b79d94 100644 --- a/tests/job-kill/01-remote/suite.rc +++ b/tests/job-kill/01-remote/suite.rc @@ -1,9 +1,7 @@ #!Jinja2 [cylc] [[reference test]] - required run mode=live expected task failures = t1.1, t2.1 - live mode suite timeout= PT2M [scheduling] [[graph]] R1=""" diff --git a/tests/job-kill/02-loadleveler/suite.rc b/tests/job-kill/02-loadleveler/suite.rc index 965618d26d4..5fcec2028a3 100644 --- a/tests/job-kill/02-loadleveler/suite.rc +++ b/tests/job-kill/02-loadleveler/suite.rc @@ -1,9 +1,7 @@ #!Jinja2 [cylc] [[reference test]] - required run mode=live expected task failures = t1.1 - live mode suite timeout= PT5M [scheduling] [[graph]] R1=t1:start=>stop diff --git a/tests/job-kill/03-slurm/suite.rc b/tests/job-kill/03-slurm/suite.rc index 8a304cede03..692a46d5602 100644 --- a/tests/job-kill/03-slurm/suite.rc +++ b/tests/job-kill/03-slurm/suite.rc @@ -1,9 +1,7 @@ #!Jinja2 [cylc] [[reference test]] - required run mode=live expected task failures = t1.1 - live mode suite timeout= PT5M [scheduling] [[graph]] R1=t1:start=>stop diff --git a/tests/job-kill/04-pbs/suite.rc b/tests/job-kill/04-pbs/suite.rc index b5a0d9d72bb..68681f7d6d2 100644 --- a/tests/job-kill/04-pbs/suite.rc +++ b/tests/job-kill/04-pbs/suite.rc @@ -1,9 +1,7 @@ #!Jinja2 [cylc] [[reference test]] - required run mode=live expected task failures = t1.1 - live mode suite timeout= PT5M [scheduling] [[graph]] R1=t1:start=>stop diff --git a/tests/job-submission/00-user/suite.rc b/tests/job-submission/00-user/suite.rc index f3df8c91391..68477c4a67a 100644 --- a/tests/job-submission/00-user/suite.rc +++ b/tests/job-submission/00-user/suite.rc @@ -1,10 +1,4 @@ # Test job submission modules in lib/python/ and python/ (deprecated). - -[cylc] - [[reference test]] - required run mode = live - live mode suite timeout = PT30S - [scheduling] [[graph]] R1 = foo & bar diff --git a/tests/job-submission/01-job-nn-localhost/suite.rc b/tests/job-submission/01-job-nn-localhost/suite.rc index 24eedadb515..21203b55a2a 100644 --- a/tests/job-submission/01-job-nn-localhost/suite.rc +++ b/tests/job-submission/01-job-nn-localhost/suite.rc @@ -1,8 +1,6 @@ #!jinja2 [cylc] UTC mode = True # Ignore DST - [[reference test]] - live mode suite timeout = PT10M [scheduling] [[graph]] diff --git a/tests/job-submission/06-garbage/suite.rc b/tests/job-submission/06-garbage/suite.rc index d608b997578..bc4767e0487 100644 --- a/tests/job-submission/06-garbage/suite.rc +++ b/tests/job-submission/06-garbage/suite.rc @@ -1,8 +1,6 @@ [cylc] [[reference test]] expected task failures = t1.1 - required run mode = live - live mode suite timeout = PT30S [scheduling] [[graph]] diff --git a/tests/job-submission/07-multi/suite.rc b/tests/job-submission/07-multi/suite.rc index 2345aa67626..d0d16907dfb 100644 --- a/tests/job-submission/07-multi/suite.rc +++ b/tests/job-submission/07-multi/suite.rc @@ -1,9 +1,6 @@ #!Jinja2 [cylc] UTC mode = True - [[reference test]] - required run mode = live - live mode suite timeout = PT3M [scheduling] initial cycle point=2020 diff --git a/tests/job-submission/08-activity-log-host/suite.rc b/tests/job-submission/08-activity-log-host/suite.rc index 6b2e9737151..9253d0e3ba7 100644 --- a/tests/job-submission/08-activity-log-host/suite.rc +++ b/tests/job-submission/08-activity-log-host/suite.rc @@ -1,9 +1,6 @@ #!Jinja2 [cylc] UTC mode = True - [[reference test]] - required run mode = live - live mode suite timeout = PT3M [scheduling] initial cycle point=1999 diff --git a/tests/job-submission/09-activity-log-host-bad-submit/suite.rc b/tests/job-submission/09-activity-log-host-bad-submit/suite.rc index e7bbf20bdba..2260dc3cb63 100644 --- a/tests/job-submission/09-activity-log-host-bad-submit/suite.rc +++ b/tests/job-submission/09-activity-log-host-bad-submit/suite.rc @@ -3,8 +3,6 @@ UTC mode = True [[reference test]] expected task failures = bad-submitter.19990101T0000Z - required run mode = live - live mode suite timeout = PT3M [scheduling] initial cycle point=1999 diff --git a/tests/job-submission/10-at-shell/suite.rc b/tests/job-submission/10-at-shell/suite.rc index 4efc6c84dd0..fc708c65995 100644 --- a/tests/job-submission/10-at-shell/suite.rc +++ b/tests/job-submission/10-at-shell/suite.rc @@ -1,8 +1,3 @@ -[cylc] - [[reference test]] - required run mode = live - live mode suite timeout = PT15S - [scheduling] [[graph]] R1 = foo diff --git a/tests/job-submission/11-garbage-host-command/suite.rc b/tests/job-submission/11-garbage-host-command/suite.rc index 213ab0ae866..ff3125fbd4d 100644 --- a/tests/job-submission/11-garbage-host-command/suite.rc +++ b/tests/job-submission/11-garbage-host-command/suite.rc @@ -1,8 +1,6 @@ [cylc] [[reference test]] expected task failures = t1.1 - required run mode = live - live mode suite timeout = PT30S [scheduling] [[graph]] diff --git a/tests/job-submission/12-tidy-submits-of-prev-run/suite.rc b/tests/job-submission/12-tidy-submits-of-prev-run/suite.rc index 256cf120402..41d8b7f2205 100644 --- a/tests/job-submission/12-tidy-submits-of-prev-run/suite.rc +++ b/tests/job-submission/12-tidy-submits-of-prev-run/suite.rc @@ -1,9 +1,4 @@ #!jinja2 -[cylc] - [[reference test]] - required run mode = live - live mode suite timeout = PT1M - [scheduling] [[graph]] R1 = t1 diff --git a/tests/job-submission/16-timeout/suite.rc b/tests/job-submission/16-timeout/suite.rc index 331478fe1eb..1745c9c753c 100644 --- a/tests/job-submission/16-timeout/suite.rc +++ b/tests/job-submission/16-timeout/suite.rc @@ -1,7 +1,3 @@ -[cylc] - [[events]] - abort on timeout = True - timeout = PT20S [scheduling] [[graph]] R1 = "foo:submit-fail => stopper" diff --git a/tests/job-submission/17-remote-localtime/suite.rc b/tests/job-submission/17-remote-localtime/suite.rc index 6616bb9f529..57e940bf9d8 100644 --- a/tests/job-submission/17-remote-localtime/suite.rc +++ b/tests/job-submission/17-remote-localtime/suite.rc @@ -1,8 +1,6 @@ #!jinja2 [cylc] UTC mode = False - [[reference test]] - live mode suite timeout = PT10M [scheduling] [[graph]] diff --git a/tests/jobscript/00-torture/suite.rc b/tests/jobscript/00-torture/suite.rc index ec38da0aa34..c5064c352b9 100644 --- a/tests/jobscript/00-torture/suite.rc +++ b/tests/jobscript/00-torture/suite.rc @@ -10,12 +10,6 @@ bin directory must go in PATH before the task runtime environment is defined because suite bin commands could be used in variable assignment expressions.""" -[cylc] - [[reference test]] - live mode suite timeout = PT30S - dummy mode suite timeout = PT30S - simulation mode suite timeout = PT30S - [scheduling] [[graph]] R1 = "foo" diff --git a/tests/jobscript/03-copyable-environment-variables/suite.rc b/tests/jobscript/03-copyable-environment-variables/suite.rc index 9f24fa12eb7..c1cb0b5258c 100644 --- a/tests/jobscript/03-copyable-environment-variables/suite.rc +++ b/tests/jobscript/03-copyable-environment-variables/suite.rc @@ -1,12 +1,6 @@ [meta] title = Job script: suite to environment test -[cylc] - [[reference test]] - live mode suite timeout = PT0.5M - dummy mode suite timeout = PT0.5M - simulation mode suite timeout = PT0.5M - [scheduling] [[graph]] R1 = foo diff --git a/tests/jobscript/04-global-initial-scripting/suite.rc b/tests/jobscript/04-global-initial-scripting/suite.rc index 9f24fa12eb7..c1cb0b5258c 100644 --- a/tests/jobscript/04-global-initial-scripting/suite.rc +++ b/tests/jobscript/04-global-initial-scripting/suite.rc @@ -1,12 +1,6 @@ [meta] title = Job script: suite to environment test -[cylc] - [[reference test]] - live mode suite timeout = PT0.5M - dummy mode suite timeout = PT0.5M - simulation mode suite timeout = PT0.5M - [scheduling] [[graph]] R1 = foo diff --git a/tests/jobscript/05-global-config/suite.rc b/tests/jobscript/05-global-config/suite.rc index 8bb3435aa72..723dfe5a972 100644 --- a/tests/jobscript/05-global-config/suite.rc +++ b/tests/jobscript/05-global-config/suite.rc @@ -3,11 +3,6 @@ suite to environment test execution and submission polling intervals, task communication method, connection timeout and retry interval the in flow.rc""" -[cylc] - [[reference test]] - live mode suite timeout = PT2M - simulation mode suite timeout = PT2M - [scheduling] [[graph]] R1 = "foo & bar" diff --git a/tests/jobscript/17-envfail/suite.rc b/tests/jobscript/17-envfail/suite.rc index 46ffffd4806..2b4178248ad 100644 --- a/tests/jobscript/17-envfail/suite.rc +++ b/tests/jobscript/17-envfail/suite.rc @@ -1,5 +1,6 @@ [cylc] - abort if any task fails = True + [[events]] + abort if any task fails = True [scheduling] [[graph]] R1 = foo diff --git a/tests/jobscript/cycling/suite.rc b/tests/jobscript/cycling/suite.rc index 181299ff776..15e8e67f684 100644 --- a/tests/jobscript/cycling/suite.rc +++ b/tests/jobscript/cycling/suite.rc @@ -5,10 +5,6 @@ [cylc] cycle point time zone = +13 - [[reference test]] - live mode suite timeout = PT0.5M - dummy mode suite timeout = PT0.5M - simulation mode suite timeout = PT0.5M [scheduling] initial cycle point = 20140201T05 diff --git a/tests/lib/bash/test_header b/tests/lib/bash/test_header index c3668cd37ab..c48d2ee2e59 100644 --- a/tests/lib/bash/test_header +++ b/tests/lib/bash/test_header @@ -90,7 +90,7 @@ # Tidy up test directories for SUITE_NAME. # poll COMMAND # Run COMMAND in 1 second intervals for a minute until COMMAND returns -# a non-zero value. +# a non-zero value, or exit 1 (abort test) with a timeout message. # skip N SKIP_REASON # echo "ok $((++T)) # skip SKIP_REASON" N times. # skip_all SKIP_REASON @@ -491,9 +491,19 @@ purge_suite() { poll() { local TIMEOUT="$(($(date +%s) + 60))" # wait 1 minute - while (($(date +%s) < TIMEOUT)) && eval "$@"; do - sleep 1 + local TIMED_OUT=true + while (($(date +%s) < TIMEOUT)); do + if eval "$@"; then + sleep 1 + else + TIMED_OUT=false + break + fi done + if $TIMED_OUT; then + >&2 echo "ERROR: poll timed out: $*" + exit 1 + fi } skip() { diff --git a/tests/logging/02-duplicates.t b/tests/logging/02-duplicates.t index de6e12f312b..7d3950c6c34 100644 --- a/tests/logging/02-duplicates.t +++ b/tests/logging/02-duplicates.t @@ -15,32 +15,18 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . #------------------------------------------------------------------------------- -. $(dirname $0)/test_header +. "$(dirname "$0")/test_header" #------------------------------------------------------------------------------- -set_test_number 3 +set_test_number 4 #------------------------------------------------------------------------------- install_suite "${TEST_NAME_BASE}" "${TEST_NAME_BASE}" -suite_run_ok "${TEST_NAME_BASE}-run" cylc run "${SUITE_NAME}" -while cylc ping "${SUITE_NAME}" 2>/dev/null; do - sleep 1 -done -sleep 8 -suite_run_ok "${TEST_NAME_BASE}-restart" cylc restart "${SUITE_NAME}" -while cylc ping "${SUITE_NAME}" 2>/dev/null; do - sleep 1 -done -if [[ -e "${SUITE_RUN_DIR}/work/2/pub/test-succeeded" ]]; then - ok "${TEST_NAME_BASE}-check" -else - fail "${TEST_NAME_BASE}-check" - echo 'OUT - Duplicated Entries:' >&2 - cat "${SUITE_RUN_DIR}/work/2/pub/out-duplication" >&2 - echo 'ERR - Duplicated Entries:' >&2 - cat "${SUITE_RUN_DIR}/work/2/pub/err-duplication" >&2 - echo 'LOG - Duplicated Entries:' >&2 - cat "${SUITE_RUN_DIR}/work/2/pub/log-duplication" >&2 -fi - +suite_run_ok "${TEST_NAME_BASE}-run" cylc run --no-detach "${SUITE_NAME}" +suite_run_ok "${TEST_NAME_BASE}-restart" \ + cylc restart --no-detach "${SUITE_NAME}" +run_ok "${TEST_NAME_BASE}-check" \ + test -e "${SUITE_RUN_DIR}/work/2/pub/log-duplication" +run_fail "${TEST_NAME_BASE}-check" \ + test -s "${SUITE_RUN_DIR}/work/2/pub/log-duplication" #------------------------------------------------------------------------------- purge_suite "${SUITE_NAME}" exit diff --git a/tests/logging/02-duplicates/suite.rc b/tests/logging/02-duplicates/suite.rc index aa3d89df771..05fe9552ca5 100644 --- a/tests/logging/02-duplicates/suite.rc +++ b/tests/logging/02-duplicates/suite.rc @@ -1,3 +1,8 @@ +[cylc] + [[events]] + abort on stalled = True + abort on inactivity = True + inactivity = PT3M [scheduling] cycling mode = integer initial cycle point = 1 @@ -26,22 +31,6 @@ cylc stop "${CYLC_SUITE_NAME}" script = """ # Extract timestamp lines from logs for file in $(find "${CYLC_SUITE_RUN_DIR}/log/suite/" -name '*.*'); do - if $(grep -q '.*-.*-.*' "${file}"); then - grep '.*-.*-.*' "${file}" | sort -u > $(basename $file) - else - touch $(basename $file) - fi -done - -# Write out duplicate entries to *-duplication files. -sort $(find . -name 'out*') | uniq -d > out-duplication -sort $(find . -name 'err*') | uniq -d > err-duplication -sort $(find . -name 'log*') | uniq -d > log-duplication - -# Fail if any of these files contain any content. -if [[ -s out-duplication || -s err-duplication || -s log-duplication ]]; then - touch 'test-failed' -else - touch 'test-succeeded' -fi + grep '.*-.*-.*' "${file}" | sort -u || true +done | sort | uniq -d > 'log-duplication' """ diff --git a/tests/message-triggers/02-action/suite.rc b/tests/message-triggers/02-action/suite.rc index 90f9772443d..c1982513e65 100644 --- a/tests/message-triggers/02-action/suite.rc +++ b/tests/message-triggers/02-action/suite.rc @@ -1,8 +1,8 @@ [cylc] - abort if any task fails = True [[events]] - timeout = PT30S - abort on timeout = True + abort if any task fails = True + abort on inactivity = True + inactivity = PT3M [scheduling] [[graph]] R1 = """ @@ -13,31 +13,47 @@ [[foo]] # Abort if messages don't result in the expected suite state change. script = """ -sleep 5 +wait # There should be 3 task proxies in the suite state. -cylc dump -t $CYLC_SUITE_NAME | sort > log.1 -diff log.1 - << __EOF__ +while true; do + cylc dump -t "${CYLC_SUITE_NAME}" | sort > 'log.1' + if diff 'log.1' - << __EOF__ bar, 1, waiting, unspawned, unheld baz, 1, waiting, unspawned, unheld foo, 1, running, spawned, unheld __EOF__ + then + break + fi + sleep 1 +done cylc message "the quick brown fox" -sleep 5 -# There should now be 2 task proxies in the suite state. -cylc dump -t $CYLC_SUITE_NAME | sort > log.2 -diff log.2 - << __EOF__ +while true; do + # There should now be 2 task proxies in the suite state. + cylc dump -t "${CYLC_SUITE_NAME}" | sort > 'log.2' + if diff 'log.2' - << __EOF__ baz, 1, waiting, unspawned, unheld foo, 1, running, spawned, unheld __EOF__ + then + break + fi + sleep 1 +done cylc message "jumped over the lazy dog" -sleep 5 -# There should now be only 1 task proxy in the suite state. -cylc dump -t $CYLC_SUITE_NAME | sort > log.3 -diff log.3 - << __EOF__ +while true; do + # There should now be only 1 task proxy in the suite state. + cylc dump -t "${CYLC_SUITE_NAME}" | sort > 'log.3' + if diff 'log.3' - << __EOF__ foo, 1, running, spawned, unheld __EOF__ + then + break + fi + sleep 1 +done """ [[[outputs]]] a = "the quick brown fox" diff --git a/tests/modes/dummy-message-outputs/suite.rc b/tests/modes/dummy-message-outputs/suite.rc index a8f298ebd25..c55bb188a17 100644 --- a/tests/modes/dummy-message-outputs/suite.rc +++ b/tests/modes/dummy-message-outputs/suite.rc @@ -3,8 +3,8 @@ [cylc] [[events]] abort on stalled = True - [[reference test]] - required run mode = dummy + abort on inactivity = True + inactivity = PT3M [scheduling] [[graph]] R1 = foo:x => bar diff --git a/tests/modes/dummy/suite.rc b/tests/modes/dummy/suite.rc index 28c8003ca70..a65385210f4 100644 --- a/tests/modes/dummy/suite.rc +++ b/tests/modes/dummy/suite.rc @@ -1,8 +1,7 @@ [cylc] force run mode = dummy [[reference test]] - dummy mode suite timeout = PT1M - allow task failures = True + expected task failures = a.1, b.1, c.1 [scheduling] [[graph]] R1 = """a:fail => b diff --git a/tests/modes/simulation/suite.rc b/tests/modes/simulation/suite.rc index b7aa47206dd..20dd54c6216 100644 --- a/tests/modes/simulation/suite.rc +++ b/tests/modes/simulation/suite.rc @@ -1,7 +1,5 @@ [cylc] force run mode = simulation - [[reference test]] - simulation mode suite timeout = PT1M [scheduling] [[graph]] R1 = "a => b => c" diff --git a/tests/offset/00-final-simple/suite.rc b/tests/offset/00-final-simple/suite.rc index 5ef0c3be825..1dcc79aa779 100644 --- a/tests/offset/00-final-simple/suite.rc +++ b/tests/offset/00-final-simple/suite.rc @@ -1,8 +1,5 @@ [cylc] cycle point time zone = +01 - [[reference test]] - required run mode = live - live mode suite timeout = PT1M [scheduling] initial cycle point = 20100101T00 final cycle point = +P5D diff --git a/tests/offset/01-final-next/suite.rc b/tests/offset/01-final-next/suite.rc index b678ee008d2..c839f80d41f 100644 --- a/tests/offset/01-final-next/suite.rc +++ b/tests/offset/01-final-next/suite.rc @@ -1,8 +1,9 @@ [cylc] cycle point time zone = +01 - [[reference test]] - required run mode = live - live mode suite timeout = PT1M + [[events]] + abort on stalled = True + abort on inactivity = True + inactivity = PT3M [scheduling] initial cycle point = 20100101T00 final cycle point = T06 diff --git a/tests/offset/02-final-chain/suite.rc b/tests/offset/02-final-chain/suite.rc index fe7d36627ba..669faf21270 100644 --- a/tests/offset/02-final-chain/suite.rc +++ b/tests/offset/02-final-chain/suite.rc @@ -1,8 +1,5 @@ [cylc] cycle point time zone = +01 - [[reference test]] - required run mode = live - live mode suite timeout = PT1M [scheduling] initial cycle point = 20100101T00 final cycle point = +P1D+PT6H diff --git a/tests/offset/03-final-next-chain/suite.rc b/tests/offset/03-final-next-chain/suite.rc index e4d1edf0fb7..a7a3028093b 100644 --- a/tests/offset/03-final-next-chain/suite.rc +++ b/tests/offset/03-final-next-chain/suite.rc @@ -1,8 +1,5 @@ [cylc] cycle point time zone = +01 - [[reference test]] - required run mode = live - live mode suite timeout = PT1M [scheduling] initial cycle point = 20100101T00 final cycle point = T06+PT6H diff --git a/tests/offset/04-cycle-offset-chain/suite.rc b/tests/offset/04-cycle-offset-chain/suite.rc index f889acdadca..13c7f5e3599 100644 --- a/tests/offset/04-cycle-offset-chain/suite.rc +++ b/tests/offset/04-cycle-offset-chain/suite.rc @@ -1,8 +1,5 @@ [cylc] cycle point time zone = +01 - [[reference test]] - required run mode = live - live mode suite timeout = PT1M [scheduling] initial cycle point = 20100101T00 final cycle point = T06+PT06H diff --git a/tests/offset/05-long-final-chain/suite.rc b/tests/offset/05-long-final-chain/suite.rc index 82a37ab982a..9887299673b 100644 --- a/tests/offset/05-long-final-chain/suite.rc +++ b/tests/offset/05-long-final-chain/suite.rc @@ -1,8 +1,5 @@ [cylc] cycle point time zone = +01 - [[reference test]] - required run mode = live - live mode suite timeout = PT1M [scheduling] initial cycle point = 20100101T00 final cycle point = T06+P1D+PT6H diff --git a/tests/param_expand/03-env-tmpl/suite.rc b/tests/param_expand/03-env-tmpl/suite.rc index 49ac7c3144b..fec3e88af36 100644 --- a/tests/param_expand/03-env-tmpl/suite.rc +++ b/tests/param_expand/03-env-tmpl/suite.rc @@ -2,8 +2,6 @@ [[parameters]] num = 99..101..2 stuff = this, that - [[reference test]] - live mode suite timeout = PT1M [scheduling] [[graph]] R1 = "t1 => t2" diff --git a/tests/periodicals/Daily/suite.rc b/tests/periodicals/Daily/suite.rc index 8828724ec17..8d5ce223218 100644 --- a/tests/periodicals/Daily/suite.rc +++ b/tests/periodicals/Daily/suite.rc @@ -1,8 +1,5 @@ [cylc] UTC mode = True - [[reference test]] - required run mode = live - live mode suite timeout=PT1M [scheduling] initial cycle point = 20140107 final cycle point = 20140118 diff --git a/tests/periodicals/Monthly-reorder/suite.rc b/tests/periodicals/Monthly-reorder/suite.rc index 6750cc0f244..f505e8679ba 100644 --- a/tests/periodicals/Monthly-reorder/suite.rc +++ b/tests/periodicals/Monthly-reorder/suite.rc @@ -1,8 +1,5 @@ [cylc] UTC mode = True - [[reference test]] - required run mode = live - live mode suite timeout = PT1M [scheduling] initial cycle point = 20130130T00 final cycle point = 20130202T00 diff --git a/tests/periodicals/Monthly/suite.rc b/tests/periodicals/Monthly/suite.rc index 81287c1bbe6..0bc6a174c79 100644 --- a/tests/periodicals/Monthly/suite.rc +++ b/tests/periodicals/Monthly/suite.rc @@ -1,8 +1,5 @@ [cylc] UTC mode = True - [[reference test]] - required run mode = live - live mode suite timeout = PT1M [scheduling] initial cycle point = 2010-02 final cycle point = 2010-08 diff --git a/tests/periodicals/Yearly/suite.rc b/tests/periodicals/Yearly/suite.rc index f1189fd3661..004a1ec5cc5 100644 --- a/tests/periodicals/Yearly/suite.rc +++ b/tests/periodicals/Yearly/suite.rc @@ -1,8 +1,5 @@ [cylc] UTC mode = True - [[reference test]] - required run mode = live - live mode suite timeout=PT1M [scheduling] initial cycle point = 2011 final cycle point = 2018 diff --git a/tests/pre-initial/advanced-conditional/suite.rc b/tests/pre-initial/advanced-conditional/suite.rc index 27b01a22034..e58a20d0e6f 100644 --- a/tests/pre-initial/advanced-conditional/suite.rc +++ b/tests/pre-initial/advanced-conditional/suite.rc @@ -1,8 +1,5 @@ [cylc] UTC mode = True - [[reference test]] - required run mode = live - live mode suite timeout=PT1M [scheduling] initial cycle point = 20100101T00 final cycle point = 20100102T00 diff --git a/tests/pre-initial/basic-conditional/suite.rc b/tests/pre-initial/basic-conditional/suite.rc index 046ca7226f9..406a1bd571d 100644 --- a/tests/pre-initial/basic-conditional/suite.rc +++ b/tests/pre-initial/basic-conditional/suite.rc @@ -1,8 +1,5 @@ [cylc] UTC mode = True - [[reference test]] - required run mode = live - live mode suite timeout=PT1M [scheduling] initial cycle point = 20100101T00 final cycle point = 20100102T00 diff --git a/tests/pre-initial/conditional-messaging/suite.rc b/tests/pre-initial/conditional-messaging/suite.rc index 36e796d4c2c..23c2adaa0bc 100644 --- a/tests/pre-initial/conditional-messaging/suite.rc +++ b/tests/pre-initial/conditional-messaging/suite.rc @@ -1,8 +1,6 @@ [cylc] UTC mode = True [[reference test]] - required run mode = live - live mode suite timeout = PT1M expected task failures = bar.20100809T0000Z [scheduling] diff --git a/tests/pre-initial/drop-conditional/suite.rc b/tests/pre-initial/drop-conditional/suite.rc index 4cf497231ca..17f2e837ded 100644 --- a/tests/pre-initial/drop-conditional/suite.rc +++ b/tests/pre-initial/drop-conditional/suite.rc @@ -1,8 +1,5 @@ [cylc] UTC mode = True - [[reference test]] - required run mode = live - live mode suite timeout = PT1M [scheduling] initial cycle point = 20100101T00 final cycle point = 20100102T00 diff --git a/tests/pre-initial/simple-messaging/suite.rc b/tests/pre-initial/simple-messaging/suite.rc index 29fc8907e73..dfcc16e54c5 100644 --- a/tests/pre-initial/simple-messaging/suite.rc +++ b/tests/pre-initial/simple-messaging/suite.rc @@ -1,8 +1,5 @@ [cylc] UTC mode = True - [[reference test]] - required run mode = live - live mode suite timeout=PT1M [scheduling] initial cycle point = 20100808T00 final cycle point = 20100809T00 diff --git a/tests/pre-initial/simple/suite.rc b/tests/pre-initial/simple/suite.rc index ed60406f30f..65d3b98517a 100644 --- a/tests/pre-initial/simple/suite.rc +++ b/tests/pre-initial/simple/suite.rc @@ -1,8 +1,5 @@ [cylc] UTC mode = True - [[reference test]] - required run mode = live - live mode suite timeout=PT1M [scheduling] initial cycle point = 20100101T00 final cycle point = 20100102T00 diff --git a/tests/pre-initial/warm-insert-stall/suite.rc b/tests/pre-initial/warm-insert-stall/suite.rc index 958b5e0fec0..bd1e3d25cdc 100644 --- a/tests/pre-initial/warm-insert-stall/suite.rc +++ b/tests/pre-initial/warm-insert-stall/suite.rc @@ -4,8 +4,6 @@ abort on inactivity = True abort on stalled = True inactivity = PT1M - [[reference test]] - live mode suite timeout = PT1M [scheduling] initial cycle point = 20100101T0000Z diff --git a/tests/pre-initial/warm-insert/suite.rc b/tests/pre-initial/warm-insert/suite.rc index 22846eca415..da21bf6e395 100644 --- a/tests/pre-initial/warm-insert/suite.rc +++ b/tests/pre-initial/warm-insert/suite.rc @@ -5,8 +5,6 @@ stalled handler = cylc trigger %(suite)s foo.20100101T1200Z abort on timeout = True timeout = PT2M - [[reference test]] - live mode suite timeout=PT2M [scheduling] initial cycle point = 20100101T0000Z diff --git a/tests/pre-initial/warm-offset/suite.rc b/tests/pre-initial/warm-offset/suite.rc index e7cb4eb4d73..f05781244c7 100644 --- a/tests/pre-initial/warm-offset/suite.rc +++ b/tests/pre-initial/warm-offset/suite.rc @@ -1,8 +1,5 @@ [cylc] UTC mode = True - [[reference test]] - required run mode = live - live mode suite timeout=PT1M [scheduling] initial cycle point = 20130101T00 final cycle point = 20130102T00 diff --git a/tests/pre-initial/warm-start-iso/suite.rc b/tests/pre-initial/warm-start-iso/suite.rc index 9a8de7fba5f..e997189bf69 100644 --- a/tests/pre-initial/warm-start-iso/suite.rc +++ b/tests/pre-initial/warm-start-iso/suite.rc @@ -1,8 +1,5 @@ [cylc] UTC mode = True - [[reference test]] - required run mode = live - live mode suite timeout = PT1M [scheduling] initial cycle point = 20130101T00 final cycle point = 20130103T00 diff --git a/tests/pre-initial/warm-start/suite.rc b/tests/pre-initial/warm-start/suite.rc index e7cb4eb4d73..f05781244c7 100644 --- a/tests/pre-initial/warm-start/suite.rc +++ b/tests/pre-initial/warm-start/suite.rc @@ -1,8 +1,5 @@ [cylc] UTC mode = True - [[reference test]] - required run mode = live - live mode suite timeout=PT1M [scheduling] initial cycle point = 20130101T00 final cycle point = 20130102T00 diff --git a/tests/queues/qsize/suite.rc b/tests/queues/qsize/suite.rc index 2e66bd21264..28a9b002217 100644 --- a/tests/queues/qsize/suite.rc +++ b/tests/queues/qsize/suite.rc @@ -1,8 +1,4 @@ #!Jinja2 -[cylc] - [[reference test]] - required run mode = live - live mode suite timeout = PT2M [scheduling] [[ queues ]] [[[ q_fam ]]] @@ -12,7 +8,7 @@ R1 = monitor:start => FAM [runtime] [[FAM]] - script = sleep 10 + script = true [[a,b,c,d,e,f,g,h,i,j,k,l]] inherit = FAM [[monitor]] diff --git a/tests/recurrence-min/00-basic/suite.rc b/tests/recurrence-min/00-basic/suite.rc index 284ec6c5796..4e470d9a3b5 100644 --- a/tests/recurrence-min/00-basic/suite.rc +++ b/tests/recurrence-min/00-basic/suite.rc @@ -1,8 +1,5 @@ [cylc] UTC mode = true -[[reference test]] -required run mode = live -live mode suite timeout = PT1M # minutes [scheduling] initial cycle point = 20100101T03 [[graph]] diff --git a/tests/recurrence-min/01-offset-initial/suite.rc b/tests/recurrence-min/01-offset-initial/suite.rc index 1b4550cc593..cd932834f9d 100644 --- a/tests/recurrence-min/01-offset-initial/suite.rc +++ b/tests/recurrence-min/01-offset-initial/suite.rc @@ -1,8 +1,5 @@ [cylc] UTC mode = true -[[reference test]] -required run mode = live -live mode suite timeout = PT1M # minutes [scheduling] initial cycle point = 20100101T03 [[graph]] diff --git a/tests/recurrence-min/02-offset-truncated/suite.rc b/tests/recurrence-min/02-offset-truncated/suite.rc index d54d425c3b7..13f8079ad0f 100644 --- a/tests/recurrence-min/02-offset-truncated/suite.rc +++ b/tests/recurrence-min/02-offset-truncated/suite.rc @@ -1,8 +1,5 @@ [cylc] UTC mode = true -[[reference test]] -required run mode = live -live mode suite timeout = PT1M # minutes [scheduling] initial cycle point = 20100101T03 [[graph]] diff --git a/tests/recurrence-min/03-neg-offset-truncated/suite.rc b/tests/recurrence-min/03-neg-offset-truncated/suite.rc index 6e0ecb5e320..19458759fea 100644 --- a/tests/recurrence-min/03-neg-offset-truncated/suite.rc +++ b/tests/recurrence-min/03-neg-offset-truncated/suite.rc @@ -1,8 +1,5 @@ [cylc] UTC mode = true -[[reference test]] -required run mode = live -live mode suite timeout = PT1M # minutes [scheduling] initial cycle point = 20100101T03 [[graph]] diff --git a/tests/registration/02-on-the-fly.t b/tests/registration/02-on-the-fly.t index 260151f101d..2abd400ee3e 100755 --- a/tests/registration/02-on-the-fly.t +++ b/tests/registration/02-on-the-fly.t @@ -42,9 +42,9 @@ contains_ok "${TEST_NAME}-run.stdout" <<__ERR__ REGISTERED ${TESTD} -> ${PWD} __ERR__ -run_ok "${TEST_NAME}-stop" cylc stop "${TESTD}" +run_ok "${TEST_NAME}-stop" cylc stop --max-polls=10 --interval=2 "${TESTD}" -purge_suite $TESTD +purge_suite "${TESTD}" #------------------------------------------------------------------------------ # Test `cylc run` REG for an un-registered suite TESTD="cylctb-${CYLC_TEST_TIME_INIT}/${TEST_NAME_BASE}" @@ -68,9 +68,9 @@ contains_ok "${TEST_NAME}-run.stdout" <<__ERR__ REGISTERED ${TESTD} -> ${CYLC_RUN_DIR}/${TESTD} __ERR__ -run_ok "${TEST_NAME}stop-" cylc stop "${TESTD}" +run_ok "${TEST_NAME}-stop" cylc stop --max-polls=10 --interval=2 "${TESTD}" -purge_suite $TESTD +purge_suite "${TESTD}" #------------------------------------------------------------------------------ # Test `cylc run` REG for an un-registered suite mkdir -p "${CYLC_RUN_DIR}/${TESTD}" @@ -94,6 +94,6 @@ contains_ok "${TEST_NAME}-validate.stderr" <<__ERR__ IllegalItemError: sched __ERR__ -purge_suite $TESTD +purge_suite "${TESTD}" exit diff --git a/tests/reload/11-retrying.t b/tests/reload/11-retrying.t index c6c1b55f770..e0e31ee2fc0 100644 --- a/tests/reload/11-retrying.t +++ b/tests/reload/11-retrying.t @@ -16,16 +16,13 @@ # along with this program. If not, see . #------------------------------------------------------------------------------- # Test that a reloaded retrying does does retry; ref github #945 -. $(dirname $0)/test_header -#------------------------------------------------------------------------------- +. "$(dirname "$0")/test_header" set_test_number 2 +install_suite "${TEST_NAME_BASE}" 'retrying' #------------------------------------------------------------------------------- -install_suite $TEST_NAME_BASE retrying -#------------------------------------------------------------------------------- -TEST_NAME=$TEST_NAME_BASE-validate -run_ok $TEST_NAME cylc validate $SUITE_NAME -#------------------------------------------------------------------------------- -TEST_NAME=$TEST_NAME_BASE-run -suite_run_ok $TEST_NAME cylc run --debug --no-detach --reference-test $SUITE_NAME +run_ok "${TEST_NAME_BASE}-validate" cylc validate "${SUITE_NAME}" +suite_run_ok "${TEST_NAME_BASE}-run" \ + cylc run --debug --no-detach --reference-test "${SUITE_NAME}" #------------------------------------------------------------------------------- -purge_suite $SUITE_NAME +purge_suite "${SUITE_NAME}" +exit diff --git a/tests/reload/14-waiting/suite.rc b/tests/reload/14-waiting/suite.rc index ab9e752bb64..804d56e7967 100644 --- a/tests/reload/14-waiting/suite.rc +++ b/tests/reload/14-waiting/suite.rc @@ -1,12 +1,6 @@ [meta] title = Test reload waiting task integrity error -[cylc] - [[reference test]] - live mode suite timeout = PT0.5M - dummy mode suite timeout = PT0.5M - simulation mode suite timeout = PT0.5M - [scheduling] [[graph]] R1 = """ diff --git a/tests/reload/17-graphing-change.t b/tests/reload/17-graphing-change.t index 6524521f992..a5e2b184c4b 100755 --- a/tests/reload/17-graphing-change.t +++ b/tests/reload/17-graphing-change.t @@ -16,77 +16,71 @@ # along with this program. If not, see . #------------------------------------------------------------------------------- # Test that removing a task from the graph works OK. -. $(dirname $0)/test_header +. "$(dirname "$0")/test_header" #------------------------------------------------------------------------------- set_test_number 13 #------------------------------------------------------------------------------- # test reporting of added tasks # install suite -install_suite $TEST_NAME_BASE graphing-change -LOG_FILE="$HOME/cylc-run/$SUITE_NAME/log/suite/log" -TEST_NAME=$TEST_NAME_BASE-add-run +install_suite "${TEST_NAME_BASE}" 'graphing-change' +LOG_FILE="${SUITE_RUN_DIR}/log/suite/log" # start suite in held mode -run_ok $TEST_NAME cylc run --hold $SUITE_NAME -sleep 5 +run_ok "${TEST_NAME_BASE}-add-run" cylc run --hold "${SUITE_NAME}" # change the suite.rc file -cp "$TEST_SOURCE_DIR/graphing-change/suite-1.rc" "$TEST_DIR/$SUITE_NAME/suite.rc" +cp "${TEST_SOURCE_DIR}/graphing-change/suite-1.rc" \ + "${TEST_DIR}/${SUITE_NAME}/suite.rc" # reload suite -TEST_NAME=$TEST_NAME_BASE-add-reload -run_ok $TEST_NAME cylc reload $SUITE_NAME +run_ok "${TEST_NAME_BASE}-add-reload" cylc reload "${SUITE_NAME}" while (($(grep -c 'Reload completed' "${LOG_FILE}" || true) < 1)); do sleep 1 # make sure reload 1 completes done # check suite log -grep_ok "Added task: 'one'" $LOG_FILE +grep_ok "Added task: 'one'" "${LOG_FILE}" #------------------------------------------------------------------------------- # test reporting or removed tasks # change the suite.rc file -cp "$TEST_SOURCE_DIR/graphing-change/suite.rc" "$TEST_DIR/$SUITE_NAME/suite.rc" +cp "${TEST_SOURCE_DIR}/graphing-change/suite.rc" \ + "${TEST_DIR}/${SUITE_NAME}/suite.rc" # reload suite -TEST_NAME=$TEST_NAME_BASE-remove-reload -run_ok $TEST_NAME cylc reload $SUITE_NAME +run_ok "${TEST_NAME_BASE}-remove-reload" cylc reload "${SUITE_NAME}" while (($(grep -c 'Reload completed' "${LOG_FILE}" || true) < 2)); do sleep 1 # make sure reload 2 completes done # check suite log -grep_ok "Removed task: 'one'" $LOG_FILE +grep_ok "Removed task: 'one'" "${LOG_FILE}" #------------------------------------------------------------------------------- # test reporting of adding / removing / swapping tasks # set suite running -TEST_NAME=$TEST_NAME_BASE-unhold -run_ok $TEST_NAME cylc unhold $SUITE_NAME +run_ok "${TEST_NAME_BASE}-release" cylc release "${SUITE_NAME}" # change the suite.rc file -cp "$TEST_SOURCE_DIR/graphing-change/suite-2.rc" "$TEST_DIR/$SUITE_NAME/suite.rc" +cp "${TEST_SOURCE_DIR}/graphing-change/suite-2.rc" \ + "${TEST_DIR}/${SUITE_NAME}/suite.rc" # reload suite -TEST_NAME=$TEST_NAME_BASE-swap-reload -run_ok $TEST_NAME cylc reload $SUITE_NAME +run_ok "${TEST_NAME_BASE}-swap-reload" cylc reload "${SUITE_NAME}" while (($(grep -c 'Reload completed' "${LOG_FILE}" || true) < 3)); do sleep 1 # make sure reload 3 completes done # check suite log -TEST_NAME=$TEST_NAME_BASE-swap-log -grep_ok "Added task: 'one'" $LOG_FILE -grep_ok "Added task: 'add'" $LOG_FILE -grep_ok "Added task: 'boo'" $LOG_FILE -grep_ok "\[bar.*\].*orphaned" $LOG_FILE -grep_ok "\[bol.*\].*orphaned" $LOG_FILE +grep_ok "Added task: 'one'" "${LOG_FILE}" +grep_ok "Added task: 'add'" "${LOG_FILE}" +grep_ok "Added task: 'boo'" "${LOG_FILE}" +grep_ok "\\[bar.*\\].*orphaned" "${LOG_FILE}" +grep_ok "\\[bol.*\\].*orphaned" "${LOG_FILE}" -# shutdown suite -TEST_NAME=$TEST_NAME_BASE-shutdown -run_ok $TEST_NAME cylc shutdown $SUITE_NAME +run_ok "${TEST_NAME_BASE}-stop" \ + cylc stop --max-polls=10 --interval=2 "${SUITE_NAME}" -# tidy up -purge_suite $SUITE_NAME -#------------------------------------------------------------------------------- +purge_suite "${SUITE_NAME}" +exit diff --git a/tests/reload/18-broadcast-insert/suite-2.rc b/tests/reload/18-broadcast-insert/suite-2.rc index 101cfc931f8..c21fc451fb8 100644 --- a/tests/reload/18-broadcast-insert/suite-2.rc +++ b/tests/reload/18-broadcast-insert/suite-2.rc @@ -1,7 +1,3 @@ -[cylc] - [[reference test]] - live mode suite timeout = PT1M - required run mode = live [scheduling] [[graph]] R1=foo&bar diff --git a/tests/reload/18-broadcast-insert/suite.rc b/tests/reload/18-broadcast-insert/suite.rc index 3e6cda97b57..43bff8212be 100644 --- a/tests/reload/18-broadcast-insert/suite.rc +++ b/tests/reload/18-broadcast-insert/suite.rc @@ -1,7 +1,3 @@ -[cylc] - [[reference test]] - live mode suite timeout = PT1M - required run mode = live [scheduling] [[graph]] R1=foo diff --git a/tests/reload/19-remote-kill/suite.rc b/tests/reload/19-remote-kill/suite.rc index f109f2b0cc9..5701b7d478d 100644 --- a/tests/reload/19-remote-kill/suite.rc +++ b/tests/reload/19-remote-kill/suite.rc @@ -3,8 +3,6 @@ [[events]] abort on stalled = True [[reference test]] - live mode suite timeout = PT1M - required run mode = live expected task failures = foo.1 [scheduling] [[graph]] diff --git a/tests/reload/20-stop-point/suite.rc b/tests/reload/20-stop-point/suite.rc index ec31ea86008..c42954a3dd5 100644 --- a/tests/reload/20-stop-point/suite.rc +++ b/tests/reload/20-stop-point/suite.rc @@ -2,9 +2,6 @@ [cylc] [[events]] abort on stalled = True - [[reference test]] - live mode suite timeout = PT1M - required run mode = live [scheduling] cycling mode = integer initial cycle point = 1 diff --git a/tests/reload/21-submit-fail/suite.rc b/tests/reload/21-submit-fail/suite.rc index a94c79350a7..750993523fd 100644 --- a/tests/reload/21-submit-fail/suite.rc +++ b/tests/reload/21-submit-fail/suite.rc @@ -3,8 +3,6 @@ [[events]] abort on stalled = True [[reference test]] - live mode suite timeout = PT1M - required run mode = live expected task failures = t1.1 [scheduling] [[graph]] diff --git a/tests/reload/add-task/suite.rc b/tests/reload/add-task/suite.rc index 183e39ebee6..76abbfeb450 100644 --- a/tests/reload/add-task/suite.rc +++ b/tests/reload/add-task/suite.rc @@ -2,11 +2,6 @@ title = "Test insertion of a task added by a reload." # Don't run this suite in-place: it modifies itself. -[cylc] - [[reference test]] - required run mode = live - live mode suite timeout = PT30S - [scheduling] [[graph]] R1 = reloader diff --git a/tests/reload/content/suite.rc b/tests/reload/content/suite.rc index d1bd9f89d34..b4b23ea9dd7 100644 --- a/tests/reload/content/suite.rc +++ b/tests/reload/content/suite.rc @@ -3,11 +3,6 @@ description = """two tasks: the second will fail, causing the test to fail, unless the first reloads the suite definition after modifying it.""" -[cylc] - [[reference test]] - required run mode = live - live mode suite timeout = PT30S - [scheduling] [[graph]] R1 = "reloader => foo" diff --git a/tests/reload/cycle-times/suite.rc b/tests/reload/cycle-times/suite.rc index 52f5aa1b0fa..cb629f062a5 100644 --- a/tests/reload/cycle-times/suite.rc +++ b/tests/reload/cycle-times/suite.rc @@ -4,9 +4,6 @@ [cylc] UTC mode = True - [[reference test]] - required run mode = live - live mode suite timeout=PT1M [scheduling] initial cycle point = 20100101T00 diff --git a/tests/reload/final-cycle/suite.rc b/tests/reload/final-cycle/suite.rc index f932a9399d9..66da19cf9c5 100644 --- a/tests/reload/final-cycle/suite.rc +++ b/tests/reload/final-cycle/suite.rc @@ -4,9 +4,6 @@ [cylc] UTC mode = True - [[reference test]] - required run mode = live - live mode suite timeout = PT1M [scheduling] initial cycle point = 20100101T00 diff --git a/tests/reload/garbage/suite.rc b/tests/reload/garbage/suite.rc index 96e484fda32..3ce7fa66ea5 100644 --- a/tests/reload/garbage/suite.rc +++ b/tests/reload/garbage/suite.rc @@ -1,8 +1,3 @@ -[cylc] - [[reference test]] - required run mode = live - live mode suite timeout=PT1M - [scheduling] [[graph]] # marker R1 = reloader => foo diff --git a/tests/reload/graphing-change/suite-1.rc b/tests/reload/graphing-change/suite-1.rc index d4abb3ee7c5..b32775a49fb 100644 --- a/tests/reload/graphing-change/suite-1.rc +++ b/tests/reload/graphing-change/suite-1.rc @@ -6,4 +6,4 @@ PT1H = foo => bar => baz => bol [runtime] [[root]] - script = sleep 1 + script = true diff --git a/tests/reload/graphing-change/suite-2.rc b/tests/reload/graphing-change/suite-2.rc index dea26c1ada9..62b6953422b 100644 --- a/tests/reload/graphing-change/suite-2.rc +++ b/tests/reload/graphing-change/suite-2.rc @@ -6,4 +6,4 @@ PT1H = add => foo => boo => baz [runtime] [[root]] - script = sleep 1 + script = true diff --git a/tests/reload/graphing-change/suite.rc b/tests/reload/graphing-change/suite.rc index 7999d11f368..2b6000a65e7 100644 --- a/tests/reload/graphing-change/suite.rc +++ b/tests/reload/graphing-change/suite.rc @@ -6,4 +6,4 @@ PT1H = foo => bar => baz => bol [runtime] [[root]] - script = sleep 1 + script = true diff --git a/tests/reload/graphing-fam/suite.rc b/tests/reload/graphing-fam/suite.rc index 4e0e071bb00..4fc6c29a199 100644 --- a/tests/reload/graphing-fam/suite.rc +++ b/tests/reload/graphing-fam/suite.rc @@ -2,11 +2,6 @@ title = queue size reload test description = """change family triggering order via a reload.""" -[cylc] - [[reference test]] - required run mode = live - live mode suite timeout=PT1M - [scheduling] [[graph]] R1 = """ diff --git a/tests/reload/graphing-simple/suite.rc b/tests/reload/graphing-simple/suite.rc index a9fd4ba3a4e..72009485698 100644 --- a/tests/reload/graphing-simple/suite.rc +++ b/tests/reload/graphing-simple/suite.rc @@ -2,11 +2,6 @@ title = queue size reload test description = """change graphing order via a reload.""" -[cylc] - [[reference test]] - required run mode = live - live mode suite timeout=PT1M - [scheduling] [[graph]] R1 = reloader => bar => foo # marker diff --git a/tests/reload/inheritance/suite.rc b/tests/reload/inheritance/suite.rc index 28ced04ba6d..60fcca08e66 100644 --- a/tests/reload/inheritance/suite.rc +++ b/tests/reload/inheritance/suite.rc @@ -2,11 +2,6 @@ title = queue size reload test description = """change inheritance via a reload.""" -[cylc] - [[reference test]] - required run mode = live - live mode suite timeout = PT30S - [scheduling] [[graph]] R1 = reloader => inheritor diff --git a/tests/reload/queues/suite.rc b/tests/reload/queues/suite.rc index b93d68911d6..c545e76a7cb 100644 --- a/tests/reload/queues/suite.rc +++ b/tests/reload/queues/suite.rc @@ -2,11 +2,6 @@ title = queue size reload test description = """change the size of a queue via a reload.""" -[cylc] - [[reference test]] - required run mode = live - live mode suite timeout=PT1M - [scheduling] [[ queues ]] [[[ q_fam ]]] diff --git a/tests/reload/remove-add-alter-task/suite.rc b/tests/reload/remove-add-alter-task/suite.rc index 57bb4dddbd4..ce5630681f0 100644 --- a/tests/reload/remove-add-alter-task/suite.rc +++ b/tests/reload/remove-add-alter-task/suite.rc @@ -4,9 +4,6 @@ [cylc] UTC mode = True - [[reference test]] - required run mode = live - live mode suite timeout = PT60S [scheduling] [[graph]] diff --git a/tests/reload/remove-task/suite.rc b/tests/reload/remove-task/suite.rc index 9550a6300c6..954d767364f 100644 --- a/tests/reload/remove-task/suite.rc +++ b/tests/reload/remove-task/suite.rc @@ -1,10 +1,5 @@ [meta] title = "test reloading after manually removing a task." - -[cylc] - [[reference test]] - required run mode = live - live mode suite timeout = PT30S [scheduling] [[graph]] R1 = """ diff --git a/tests/reload/retrying/reference.log b/tests/reload/retrying/reference.log index 06823c56b34..c4adbc69a66 100644 --- a/tests/reload/retrying/reference.log +++ b/tests/reload/retrying/reference.log @@ -1,5 +1,5 @@ -2014/04/29 16:12:17 INFO - Initial point: 1 -2014/04/29 16:12:17 INFO - Final point: 1 -2014/04/29 16:12:17 INFO - [retrier.1] -triggered off [] -2014/04/29 16:12:17 INFO - [reloader.1] -triggered off [] -2014/04/29 16:12:37 INFO - [retrier.1] -triggered off [] +Initial point: 1 +Final point: 1 +[retrier.1] -triggered off [] +[reloader.1] -triggered off [] +[retrier.1] -triggered off [] diff --git a/tests/reload/retrying/suite.rc b/tests/reload/retrying/suite.rc index c2ce567c242..c4a1e33465a 100644 --- a/tests/reload/retrying/suite.rc +++ b/tests/reload/retrying/suite.rc @@ -2,22 +2,31 @@ title = "test that a reloaded retrying task does retry" description = """this requires some state vars to be carried over to the new task proxy; ref github #945""" - -[cylc] - [[reference test]] - required run mode = live - live mode suite timeout = PT30S [scheduling] [[graph]] - R1 = "retrier & reloader" + R1 = retrier & reloader [runtime] [[retrier]] - script = "((CYLC_TASK_TRY_NUMBER >= 2)) || exit 1" - # ( '|| exit 1' required to trigger error trap in bash 4.2.0) + script = """ +wait +sleep 1 +if ((CYLC_TASK_TRY_NUMBER == 1)); then + # Kill the job, so task will go into retrying (held) + cylc kill "${CYLC_SUITE_NAME}" 'retrier.1' + sleep 120 # Does not matter how long as the job will be killed +fi +""" [[[job]]] - execution retry delays = 1*PT6S + execution retry delays = PT0S [[reloader]] script = """ -cylc suite-state --max-polls=10 --interval=1 --task=retrier --point=1 \ - --status=retrying $CYLC_SUITE_NAME -cylc reload $CYLC_SUITE_NAME""" +while ! grep -qF '[retrier.1] -running (held) => retrying (held)' "${CYLC_SUITE_LOG_DIR}/log" +do + sleep 1 +done +cylc reload "${CYLC_SUITE_NAME}" +while ! grep -qF 'Reload completed.' "${CYLC_SUITE_LOG_DIR}/log"; do + sleep 1 +done +cylc release "${CYLC_SUITE_NAME}" 'retrier.1' +""" diff --git a/tests/reload/simple/suite.rc b/tests/reload/simple/suite.rc index e3fcec85a7c..084579ad6eb 100644 --- a/tests/reload/simple/suite.rc +++ b/tests/reload/simple/suite.rc @@ -1,7 +1,3 @@ -[cylc] - [[reference test]] - required run mode = live - live mode suite timeout=PT1M [scheduling] [[graph]] R1 = "a => b => c" diff --git a/tests/reload/startup/suite.rc b/tests/reload/startup/suite.rc index 09b59c0dba5..5e2438b8eff 100644 --- a/tests/reload/startup/suite.rc +++ b/tests/reload/startup/suite.rc @@ -1,8 +1,5 @@ [cylc] cycle point format = "%Y%m%dT%H" - [[reference test]] - required run mode = live - live mode suite timeout = PT90S [scheduling] initial cycle point = 20100101T00 final cycle point = 20100102T00 diff --git a/tests/remote/basic/bin/cleanup.sh b/tests/remote/basic/bin/cleanup.sh deleted file mode 100755 index 77fc59aa8d6..00000000000 --- a/tests/remote/basic/bin/cleanup.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -# remove installed remote passphrase -set -e -cylc check-triggering "$@" -if [[ $CYLC_TEST_OWNER@$CYLC_TEST_HOST == $USER@localhost || \ - $CYLC_TEST_OWNER@$CYLC_TEST_HOST == $USER@$(hostname) ]]; then - exit -fi -echo "Done" diff --git a/tests/remote/basic/suite.rc b/tests/remote/basic/suite.rc index b85680988aa..686558bd814 100644 --- a/tests/remote/basic/suite.rc +++ b/tests/remote/basic/suite.rc @@ -5,11 +5,6 @@ # whether or not ssh messaging is used back from the remote host is # determined by the [hosts] section in site/user config files. - -[cylc] - [[reference test]] - live mode suite timeout = PT30S - suite shutdown event handler = cleanup.sh [scheduling] [[graph]] R1 = "foo => bar" diff --git a/tests/restart/00-pre-initial/suite.rc b/tests/restart/00-pre-initial/suite.rc index 6793d99ee0d..78f357e1149 100644 --- a/tests/restart/00-pre-initial/suite.rc +++ b/tests/restart/00-pre-initial/suite.rc @@ -2,8 +2,9 @@ [cylc] UTC mode = True [[events]] - abort on timeout = True - timeout = PT1M + abort on stalled = True + abort on inactivity = True + inactivity = PT3M [scheduling] initial cycle point = 20100808T00 final cycle point = 20100808T06 diff --git a/tests/restart/03-retrying.t b/tests/restart/03-retrying.t new file mode 100755 index 00000000000..f0c943cb17e --- /dev/null +++ b/tests/restart/03-retrying.t @@ -0,0 +1,58 @@ +#!/bin/bash +# THIS FILE IS PART OF THE CYLC SUITE ENGINE. +# Copyright (C) 2008-2019 NIWA & British Crown (Met Office) & Contributors. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +#------------------------------------------------------------------------------- +# Test restarting a simple suite with a task in a retrying state. +. "$(dirname "$0")/test_header" +set_test_number 5 +init_suite "${TEST_NAME_BASE}" <<'__SUITERC__' +[cylc] + [[events]] + abort on stalled = True + abort on inactivity = True + inactivity = PT3M +[scheduling] + [[graph]] + R1 = t1 +[runtime] + [[t1]] + script = """ + wait + if ((CYLC_TASK_TRY_NUMBER == 1)); then + cylc stop "${CYLC_SUITE_NAME}" + exit 1 + fi + """ + [[[job]]] + execution retry delays = PT0S +__SUITERC__ +#------------------------------------------------------------------------------- +run_ok "${TEST_NAME_BASE}-validate" cylc validate "${SUITE_NAME}" +suite_run_ok "${TEST_NAME_BASE}-run" \ + cylc run --debug --no-detach "${SUITE_NAME}" +sqlite3 "${SUITE_RUN_DIR}/log/db" 'SELECT * FROM task_pool' >'sqlite3.out' +cmp_ok 'sqlite3.out' <<'__DB_DUMP__' +1|t1|1|retrying|0 +__DB_DUMP__ +suite_run_ok "${TEST_NAME_BASE}-restart" \ + cylc restart --debug --no-detach "${SUITE_NAME}" +sqlite3 "${SUITE_RUN_DIR}/log/db" 'SELECT * FROM task_pool' >'sqlite3.out' +cmp_ok 'sqlite3.out' <<'__DB_DUMP__' +1|t1|1|succeeded|0 +__DB_DUMP__ +#------------------------------------------------------------------------------- +purge_suite "${SUITE_NAME}" +exit diff --git a/tests/restart/04-running.t b/tests/restart/04-running.t new file mode 100755 index 00000000000..86efe9f4448 --- /dev/null +++ b/tests/restart/04-running.t @@ -0,0 +1,60 @@ +#!/bin/bash +# THIS FILE IS PART OF THE CYLC SUITE ENGINE. +# Copyright (C) 2008-2019 NIWA & British Crown (Met Office) & Contributors. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +#------------------------------------------------------------------------------- +# Test restarting a simple suite with a task still running (orphaned) +. "$(dirname "$0")/test_header" +set_test_number 5 +init_suite "${TEST_NAME_BASE}" <<'__SUITERC__' +[cylc] + [[events]] + abort on stalled = True + abort on inactivity = True + inactivity = PT3M +[scheduling] + [[graph]] + R1 = t1 +[runtime] + [[t1]] + script = """ + wait + cylc stop --now "${CYLC_SUITE_NAME}" + while ! grep -q 'Run: (re)start=1' "${CYLC_SUITE_LOG_DIR}/log"; do + sleep 1 + done + while [[ ! -s "${CYLC_SUITE_RUN_DIR}/.service/contact" ]]; do + sleep 1 + done + # Should be good to send succeeded message at this point + """ +__SUITERC__ +#------------------------------------------------------------------------------- +run_ok "${TEST_NAME_BASE}-validate" cylc validate "${SUITE_NAME}" +suite_run_ok "${TEST_NAME_BASE}-run" \ + cylc run --debug --no-detach "${SUITE_NAME}" +sqlite3 "${SUITE_RUN_DIR}/log/db" 'SELECT * FROM task_pool' >'sqlite3.out' +cmp_ok 'sqlite3.out' <<'__DB_DUMP__' +1|t1|1|running|0 +__DB_DUMP__ +suite_run_ok "${TEST_NAME_BASE}-restart" \ + cylc restart --debug --no-detach "${SUITE_NAME}" +sqlite3 "${SUITE_RUN_DIR}/log/db" 'SELECT * FROM task_pool' >'sqlite3.out' +cmp_ok 'sqlite3.out' <<'__DB_DUMP__' +1|t1|1|succeeded|0 +__DB_DUMP__ +#------------------------------------------------------------------------------- +purge_suite "${SUITE_NAME}" +exit diff --git a/tests/restart/10-pre-initial-2.t b/tests/restart/10-pre-initial-2.t index b5671047efe..36d1b8c674d 100755 --- a/tests/restart/10-pre-initial-2.t +++ b/tests/restart/10-pre-initial-2.t @@ -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 diff --git a/tests/restart/16-template-vars/suite.rc b/tests/restart/16-template-vars/suite.rc index 9827e971d35..c9659921d51 100644 --- a/tests/restart/16-template-vars/suite.rc +++ b/tests/restart/16-template-vars/suite.rc @@ -3,9 +3,6 @@ UTC mode = True [[events]] startup handler = cylc release '%(suite)s' - [[reference test]] - live mode suite timeout = PT1M - required run mode = live [scheduling] initial cycle point = 2016 final cycle point = {{FINAL_CYCLE_POINT}} diff --git a/tests/restart/18-template-vars-override/suite.rc b/tests/restart/18-template-vars-override/suite.rc index 86ca86f2091..23beb8578bd 100644 --- a/tests/restart/18-template-vars-override/suite.rc +++ b/tests/restart/18-template-vars-override/suite.rc @@ -3,9 +3,6 @@ UTC mode = True [[events]] startup handler = cylc release '%(suite)s' - [[reference test]] - live mode suite timeout = PT1M - required run mode = live [scheduling] initial cycle point = 2016 final cycle point = {{FINAL_CYCLE_POINT}} diff --git a/tests/restart/23-hold-retry.t b/tests/restart/23-hold-retry.t index afe2688ac9b..d3c4df1b3cb 100755 --- a/tests/restart/23-hold-retry.t +++ b/tests/restart/23-hold-retry.t @@ -22,31 +22,23 @@ install_suite "${TEST_NAME_BASE}" "${TEST_NAME_BASE}" run_ok "${TEST_NAME_BASE}-validate" cylc validate "${SUITE_NAME}" suite_run_ok "${TEST_NAME_BASE}-run" \ - cylc run "${SUITE_NAME}" --debug --no-detach --until=2016 -if ! which sqlite3 > /dev/null; then - skip 1 "sqlite3 not installed?" -else - sqlite3 "${SUITE_RUN_DIR}/log/db" 'SELECT * FROM task_pool ORDER BY cycle, name' \ - >'task-pool.out' - contains_ok 'task-pool.out' <<__OUT__ -2016|t2|1|retrying|1 -2017|t1|0|waiting|0 -2017|t2|0|waiting|0 + cylc run --debug --no-detach "${SUITE_NAME}" +sqlite3 "${SUITE_RUN_DIR}/log/db" \ + 'SELECT * FROM task_pool ORDER BY cycle, name' >'task-pool.out' +cmp_ok 'task-pool.out' <<__OUT__ +1|t1|1|retrying|1 __OUT__ -fi -suite_run_ok "${TEST_NAME_BASE}-restart" \ - cylc restart "${SUITE_NAME}" --debug --no-detach --until=2017 -grep_ok 'INFO - + t2\.2016 retrying (held)' "${SUITE_RUN_DIR}/log/suite/log" -if ! which sqlite3 > /dev/null; then - skip 1 "sqlite3 not installed?" -else - sqlite3 "${SUITE_RUN_DIR}/log/db" 'SELECT * FROM task_pool ORDER BY cycle, name' \ - >'task-pool.out' - contains_ok 'task-pool.out' <<__OUT__ -2016|t2|1|succeeded|0 -2018|t1|0|waiting|0 -2018|t2|0|waiting|0 +suite_run_ok "${TEST_NAME_BASE}-restart" cylc restart "${SUITE_NAME}" --debug +ls "${SUITE_RUN_DIR}/log/suite/" 1>'/dev/null' 2>&1 +poll "! grep -qF 'INFO - + t1.1 retrying (held)' '${SUITE_RUN_DIR}/log/suite/log'" +run_ok "${TEST_NAME_BASE}-release" cylc release "${SUITE_NAME}" +poll "! grep -qF 'INFO - DONE' '${SUITE_RUN_DIR}/log/suite/log'" +poll "test -e '${SUITE_RUN_DIR}/.service/contact'" +sqlite3 "${SUITE_RUN_DIR}/log/db" \ + 'SELECT * FROM task_pool ORDER BY cycle, name' >'task-pool.out' +cmp_ok 'task-pool.out' <<__OUT__ +1|t1|1|succeeded|0 __OUT__ -fi + purge_suite "${SUITE_NAME}" exit diff --git a/tests/restart/23-hold-retry/suite.rc b/tests/restart/23-hold-retry/suite.rc index 9ad9253f9c9..3b77d388907 100644 --- a/tests/restart/23-hold-retry/suite.rc +++ b/tests/restart/23-hold-retry/suite.rc @@ -1,32 +1,19 @@ -#!jinja2 [cylc] - UTC mode=True - cycle point format = %Y [[events]] abort on stalled = True abort on inactivity = True - inactivity = P1M + inactivity = P3M [scheduling] - initial cycle point = 2016 - final cycle point = 2017 [[graph]] - P1Y = t1 & t2 + R1 = t1 [runtime] [[t1]] script = """ -if [[ "${CYLC_TASK_CYCLE_POINT}" != '2016' ]]; then - cylc release "${CYLC_SUITE_NAME}" 't2.2016' -fi -""" - [[t2]] - script = """ -if [[ "${CYLC_TASK_CYCLE_POINT}" == '2016' && "${CYLC_TASK_TRY_NUMBER}" == '1' ]] -then +if ((CYLC_TASK_TRY_NUMBER == 1)); then cylc stop "${CYLC_SUITE_NAME}" - sleep 5 cylc kill "${CYLC_SUITE_NAME}" "${CYLC_TASK_ID}" - sleep 60 + sleep 120 # Should not matter because the job will be killed fi """ [[[job]]] - execution retry delays = PT4S + execution retry delays = PT0S diff --git a/tests/restart/25-hold-suite.t b/tests/restart/25-hold-suite.t index f7aef92b0ce..4dbd354df32 100755 --- a/tests/restart/25-hold-suite.t +++ b/tests/restart/25-hold-suite.t @@ -23,15 +23,11 @@ install_suite "${TEST_NAME_BASE}" "${TEST_NAME_BASE}" run_ok "${TEST_NAME_BASE}-validate" cylc validate "${SUITE_NAME}" suite_run_ok "${TEST_NAME_BASE}-run" cylc run "${SUITE_NAME}" --debug --no-detach -if ! which sqlite3 > /dev/null; then - skip 1 "sqlite3 not installed?" -else - sqlite3 "${SUITE_RUN_DIR}/log/db" \ - 'SELECT value FROM suite_params WHERE key=="is_held"' >'suite-is-held.out' - cmp_ok 'suite-is-held.out' <<<'1' -fi +sqlite3 "${SUITE_RUN_DIR}/log/db" \ + 'SELECT value FROM suite_params WHERE key=="is_held"' >'suite-is-held.out' +cmp_ok 'suite-is-held.out' <<<'1' T1_2016_PID="$(sed -n 's/CYLC_JOB_PID=//p' "${SUITE_RUN_DIR}/log/job/2016/t1/01/job.status")" -poll ps "${T1_2016_PID}" +poll ps "${T1_2016_PID}" 2>'/dev/null' cylc restart "${SUITE_NAME}" --debug --no-detach 1>"${TEST_NAME_BASE}-restart.out" 2>&1 & CYLC_RESTART_PID=$! # Ensure suite has started @@ -41,33 +37,28 @@ poll ! test -f "${SUITE_RUN_DIR}/log/job/2016/t2/01/job.status" poll ! grep -q 'CYLC_JOB_EXIT' "${SUITE_RUN_DIR}/log/job/2016/t2/01/job.status" sleep 1 -if ! which sqlite3 > /dev/null; then - skip 1 "sqlite3 not installed?" -else - sqlite3 "${SUITE_RUN_DIR}/log/db" \ - 'SELECT status,is_held FROM task_pool WHERE cycle=="2017" AND name=="t2"' \ - >'task-pool.out' - cmp_ok 'task-pool.out' <<<'waiting|1' -fi +cylc checkpoint "${SUITE_NAME}" 'before-release' cylc release "${SUITE_NAME}" cylc poll "${SUITE_NAME}" # Ensure suite has completed run_ok "${TEST_NAME_BASE}-restart" wait "${CYLC_RESTART_PID}" -if ! which sqlite3 > /dev/null; then - skip 2 "sqlite3 not installed?" -else - sqlite3 "${SUITE_RUN_DIR}/log/db" \ - 'SELECT value FROM suite_params WHERE key=="is_held"' >'suite-is-held.out' - cmp_ok 'suite-is-held.out' <'/dev/null' - sqlite3 "${SUITE_RUN_DIR}/log/db" \ - 'SELECT * FROM task_pool ORDER BY cycle, name' >'task-pool.out' - cmp_ok 'task-pool.out' <<'__OUT__' +sqlite3 "${SUITE_RUN_DIR}/log/db" \ + 'SELECT status,is_held FROM task_pool_checkpoints + WHERE id==2 AND cycle=="2017" AND name=="t2"' \ + >'task-pool.out' +cmp_ok 'task-pool.out' <<<'waiting|1' + +sqlite3 "${SUITE_RUN_DIR}/log/db" \ + 'SELECT value FROM suite_params WHERE key=="is_held"' >'suite-is-held.out' +cmp_ok 'suite-is-held.out' <'/dev/null' +sqlite3 "${SUITE_RUN_DIR}/log/db" \ + 'SELECT * FROM task_pool ORDER BY cycle, name' >'task-pool.out' +cmp_ok 'task-pool.out' <<'__OUT__' 2017|t1|1|succeeded|0 2017|t2|1|succeeded|0 2018|t1|0|waiting|0 2018|t2|0|waiting|0 __OUT__ -fi purge_suite "${SUITE_NAME}" exit diff --git a/tests/restart/25-hold-suite/suite.rc b/tests/restart/25-hold-suite/suite.rc index 0b2464b08af..2be371370ee 100644 --- a/tests/restart/25-hold-suite/suite.rc +++ b/tests/restart/25-hold-suite/suite.rc @@ -2,8 +2,8 @@ [cylc] UTC mode=True cycle point format = %Y - abort if any task fails = True [[events]] + abort if any task fails = True abort on inactivity = True inactivity = P2M [scheduling] diff --git a/tests/restart/33-simulation.t b/tests/restart/33-simulation.t index bebb2f7965f..ac138325ebe 100644 --- a/tests/restart/33-simulation.t +++ b/tests/restart/33-simulation.t @@ -22,8 +22,8 @@ set_test_number 3 init_suite "${TEST_NAME_BASE}" <<'__SUITERC__' [cylc] cycle point format = %Y - abort if any task fails = True [[events]] + abort if any task fails = True abort on stalled = True [scheduling] initial cycle point = 2018 diff --git a/tests/restart/42-auto-restart-ping-pong.t b/tests/restart/42-auto-restart-ping-pong.t index 05573be5518..2c76869909a 100644 --- a/tests/restart/42-auto-restart-ping-pong.t +++ b/tests/restart/42-auto-restart-ping-pong.t @@ -18,13 +18,14 @@ # play a game of Cylc suite ping pong bouncing a suite back and forth between # two servers by condemning them in turn in order to see if anything breaks . "$(dirname "$0")/test_header" -export CLOWNS=$( \ +CLOWNS="$( \ cylc get-global-config -i '[test battery]remote host with shared fs' \ - 2>'/dev/null') + 2>'/dev/null')" if [[ -z "${CLOWNS}" ]]; then skip_all '"[test battery]remote host with shared fs": not defined' fi -export JOKERS="$(hostname)" +export CLOWNS +export JOKERS="${HOSTNAME}" BASE_GLOBALRC=' [cylc] @@ -38,7 +39,8 @@ BASE_GLOBALRC=' TEST_DIR="$HOME/cylc-run/" init_suite "${TEST_NAME_BASE}" <<< ' [cylc] - abort if any task fails = True + [[events]] + abort if any task fails = True [scheduling] initial cycle point = 2000 final cycle point = 9999 # test cylc/cylc-flow/issues/2799 diff --git a/tests/restart/43-auto-restart-force-override-normal.t b/tests/restart/43-auto-restart-force-override-normal.t index da81ea65222..77ba3e5b8aa 100644 --- a/tests/restart/43-auto-restart-force-override-normal.t +++ b/tests/restart/43-auto-restart-force-override-normal.t @@ -17,13 +17,14 @@ #------------------------------------------------------------------------------- # Check that "Force Mode" can override a scheduler "Normal Mode" restart. . "$(dirname "$0")/test_header" -export CYLC_TEST_HOST_2=$( \ +CYLC_TEST_HOST_2="$( \ cylc get-global-config -i '[test battery]remote host with shared fs' \ - 2>'/dev/null') + 2>'/dev/null')" if [[ -z "${CYLC_TEST_HOST_2}" ]]; then skip_all '"[test battery]remote host with shared fs": not defined' fi -export CYLC_TEST_HOST_1="$(hostname)" +export CYLC_TEST_HOST_2 +export CYLC_TEST_HOST_1="${HOSTNAME}" BASE_GLOBALRC=' [cylc] @@ -37,7 +38,8 @@ BASE_GLOBALRC=' TEST_DIR="$HOME/cylc-run/" init_suite "${TEST_NAME_BASE}" <<< ' [cylc] - abort if any task fails = True + [[events]] + abort if any task fails = True [scheduling] initial cycle point = 2000 [[graph]] diff --git a/tests/restart/bad-job-host/suite.rc b/tests/restart/bad-job-host/suite.rc index 8447e1eb60f..cf2874e90c8 100644 --- a/tests/restart/bad-job-host/suite.rc +++ b/tests/restart/bad-job-host/suite.rc @@ -1,7 +1,7 @@ #!jinja2 [cylc] - abort if any task fails = True [[events]] + abort if any task fails = True timeout = PT2M abort on timeout = True [scheduling] diff --git a/tests/restart/broadcast/suite.rc b/tests/restart/broadcast/suite.rc index 3dd94cf378a..4125967644d 100644 --- a/tests/restart/broadcast/suite.rc +++ b/tests/restart/broadcast/suite.rc @@ -2,8 +2,8 @@ {%- set TEST_DIR = environ['TEST_DIR'] %} [cylc] UTC mode = True - abort if any task fails = True [[events]] + abort if any task fails = True abort on timeout = True timeout = PT1M [scheduling] diff --git a/tests/restart/pre-init-2/suite.rc b/tests/restart/pre-init-2/suite.rc index ab2e4c90271..6a3efeb6972 100644 --- a/tests/restart/pre-init-2/suite.rc +++ b/tests/restart/pre-init-2/suite.rc @@ -9,11 +9,6 @@ [cylc] cycle point format = %Y%m%dT%H - [[events]] - startup handler = cylc release '%(suite)s' - [[reference test]] - required run mode = live - live mode suite timeout = PT1M [scheduling] # DO NOT PUT AN INITIAL CYCLE TIME HERE, diff --git a/tests/restart/reload/suite.rc b/tests/restart/reload/suite.rc index 5ae7354e00e..b9fc8bccd55 100644 --- a/tests/restart/reload/suite.rc +++ b/tests/restart/reload/suite.rc @@ -8,9 +8,6 @@ which should run to completion on restarting.""" [cylc] UTC mode = True - [[reference test]] - required run mode = live - live mode suite timeout = PT2M [scheduling] initial cycle point = 20100808T00 final cycle point = 20100809T00 diff --git a/tests/retries/00-execution-retry.t b/tests/retries/00-execution-retry.t index 0d65f15fa16..0b7598583ae 100644 --- a/tests/retries/00-execution-retry.t +++ b/tests/retries/00-execution-retry.t @@ -16,30 +16,26 @@ # along with this program. If not, see . #------------------------------------------------------------------------------- # Test execution retries are working -. $(dirname $0)/test_header -#------------------------------------------------------------------------------- +. "$(dirname "$0")/test_header" set_test_number 3 +install_suite "${TEST_NAME_BASE}" 'execution' #------------------------------------------------------------------------------- -install_suite $TEST_NAME_BASE execution -#------------------------------------------------------------------------------- -TEST_NAME=$TEST_NAME_BASE-validate -run_ok $TEST_NAME cylc validate $SUITE_NAME -#------------------------------------------------------------------------------- -TEST_NAME=$TEST_NAME_BASE-run -suite_run_ok $TEST_NAME cylc run --reference-test --debug --no-detach $SUITE_NAME -#------------------------------------------------------------------------------- -if ! which sqlite3 > /dev/null; then - skip 1 "sqlite3 not installed?" -else +run_ok "${TEST_NAME_BASE}-validate" cylc validate "${SUITE_NAME}" +suite_run_ok "${TEST_NAME_BASE}-run" \ + cylc run --reference-test --debug --no-detach "${SUITE_NAME}" +if command -v 'sqlite3' >'/dev/null'; then sqlite3 \ "$(cylc get-global-config --print-run-dir)/${SUITE_NAME}/log/db" \ - 'select try_num, submit_num from task_jobs' >'select.out' + 'SELECT try_num, submit_num FROM task_jobs' >'select.out' cmp_ok 'select.out' <<'__OUT__' 1|1 2|2 3|3 4|4 __OUT__ +else + skip 1 "sqlite3 not installed?" fi #------------------------------------------------------------------------------- -purge_suite $SUITE_NAME +purge_suite "${SUITE_NAME}" +exit diff --git a/tests/retries/01-submission-retry.t b/tests/retries/01-submission-retry.t index edcf8c6fa96..375c4bb1f3a 100644 --- a/tests/retries/01-submission-retry.t +++ b/tests/retries/01-submission-retry.t @@ -16,30 +16,27 @@ # along with this program. If not, see . #------------------------------------------------------------------------------- # Test execution retries are working -. $(dirname $0)/test_header -#------------------------------------------------------------------------------- +. "$(dirname "$0")/test_header" set_test_number 3 +install_suite "${TEST_NAME_BASE}" 'submission' #------------------------------------------------------------------------------- -install_suite $TEST_NAME_BASE submission -#------------------------------------------------------------------------------- -TEST_NAME=$TEST_NAME_BASE-validate -run_ok $TEST_NAME cylc validate $SUITE_NAME -#------------------------------------------------------------------------------- -TEST_NAME=$TEST_NAME_BASE-run -suite_run_ok $TEST_NAME cylc run --reference-test --debug --no-detach $SUITE_NAME +run_ok "${TEST_NAME_BASE}-validate" cylc validate "${SUITE_NAME}" +suite_run_ok "${TEST_NAME_BASE}-run" \ + cylc run --reference-test --debug --no-detach "${SUITE_NAME}" #------------------------------------------------------------------------------- -if ! which sqlite3 > /dev/null; then - skip 1 "sqlite3 not installed?" -else +if ! command -v 'sqlite3' >'/dev/null'; then sqlite3 \ "$(cylc get-global-config --print-run-dir)/${SUITE_NAME}/log/db" \ - 'select try_num, submit_num from task_jobs' >'select.out' + 'SELECT try_num, submit_num FROM task_jobs' >'select.out' cmp_ok 'select.out' <<'__OUT__' 1|1 1|2 1|3 1|4 __OUT__ +else + skip 1 'sqlite3 not installed?' fi #------------------------------------------------------------------------------- -purge_suite $SUITE_NAME +purge_suite "${SUITE_NAME}" +exit diff --git a/tests/retries/execution/suite.rc b/tests/retries/execution/suite.rc index e3238c48861..2fc8c155c0e 100644 --- a/tests/retries/execution/suite.rc +++ b/tests/retries/execution/suite.rc @@ -1,13 +1,13 @@ [cylc] - [[reference test]] - required run mode = live - live mode suite timeout = PT1M + [[events]] + abort on stalled = True + abort on inactivity = True + inactivity = PT3M [scheduling] [[graph]] - R1 = "foo" + R1 = foo [runtime] [[foo]] - script = "((CYLC_TASK_TRY_NUMBER >= 4)) || exit 1" - # ( '|| exit 1' required to trigger error trap in bash 4.2.0) + script = test "${CYLC_TASK_TRY_NUMBER}" '-ge' '4' [[[job]]] - execution retry delays = 3*PT6S + execution retry delays = 3*PT0S diff --git a/tests/retries/submission/suite.rc b/tests/retries/submission/suite.rc index 1789c07047d..36769089102 100644 --- a/tests/retries/submission/suite.rc +++ b/tests/retries/submission/suite.rc @@ -1,8 +1,9 @@ [cylc] + [[events]] + abort on stalled = True + abort on inactivity = True + inactivity = PT3M [[reference test]] - required run mode = live - live mode suite timeout = PT1M # minutes - allow task failures = True expected task failures = foo.1 [scheduling] [[graph]] @@ -11,6 +12,6 @@ [[foo]] script = true [[[job]]] - submission retry delays = PT4S, PT5S, PT7S # 3*0.1 + submission retry delays = PT0S, PT0S, PT0S [[[remote]]] host = notahost diff --git a/tests/rnd/02-lib-python-in-job/suite.rc b/tests/rnd/02-lib-python-in-job/suite.rc index 16ff8828c5a..cc2aa36354e 100644 --- a/tests/rnd/02-lib-python-in-job/suite.rc +++ b/tests/rnd/02-lib-python-in-job/suite.rc @@ -1,5 +1,6 @@ [cylc] - abort if any task fails = True + [[events]] + abort if any task fails = True [scheduling] [[graph]] diff --git a/tests/runahead/06-release-update.t b/tests/runahead/06-release-update.t index ce0c8cd59c9..2fe61825b1c 100644 --- a/tests/runahead/06-release-update.t +++ b/tests/runahead/06-release-update.t @@ -17,28 +17,32 @@ #------------------------------------------------------------------------------- # Test that the state summary is updated when runahead tasks are released. # GitHub #1981 -. $(dirname $0)/test_header -#------------------------------------------------------------------------------- +. "$(dirname "$0")/test_header" set_test_number 3 +install_suite "${TEST_NAME_BASE}" 'release-update' #------------------------------------------------------------------------------- -install_suite $TEST_NAME_BASE release-update -#------------------------------------------------------------------------------- -TEST_NAME=$TEST_NAME_BASE-validate -run_ok $TEST_NAME cylc validate $SUITE_NAME -#------------------------------------------------------------------------------- -TEST_NAME=$TEST_NAME_BASE-check-states -cylc run $SUITE_NAME +run_ok "${TEST_NAME_BASE}-validate" cylc validate "${SUITE_NAME}" +cylc run --debug --no-detach "${SUITE_NAME}" 1>'out' 2>&1 & +CYLC_RUN_PID="$!" +poll "! test -e '${SUITE_RUN_DIR}/.service/contact'" LOG="$(cylc get-global-config --print-run-dir)/${SUITE_NAME}/log/suite/log" -poll "! grep -q -F '[bar.2016] status=running: (received)succeeded' '${LOG}' 2>'/dev/null'" +poll "! test -e '${LOG}'" +YYYY="$(date +%Y)" +poll "! grep -q -F '[bar.${YYYY}] -ready => submitted' '${LOG}' 2>'/dev/null'" +poll "! grep -q -F '[bar.${YYYY}] -running => succeeded' \ + '${LOG}' 2>'/dev/null'" sleep 1 -cylc dump -t $SUITE_NAME | awk '{print $1 $3}' > log -cmp_ok log - << __END__ +cylc dump -t "${SUITE_NAME}" | awk '{print $1 $3}' >'log' +cmp_ok 'log' - <<'__END__' bar,succeeded, bar,waiting, foo,waiting, __END__ +run_ok "${TEST_NAME_BASE}-stop" \ + cylc stop --max-polls=10 --interval=6 "${SUITE_NAME}" +if ! wait "${CYLC_RUN_PID}" 1>'/dev/null' 2>&1; then + cat 'out' >&2 +fi #------------------------------------------------------------------------------- -TEST_NAME=$TEST_NAME_BASE-stop -run_ok $TEST_NAME cylc stop --max-polls=10 --interval=6 $SUITE_NAME -#------------------------------------------------------------------------------- -purge_suite $SUITE_NAME +purge_suite "${SUITE_NAME}" +exit diff --git a/tests/runahead/release-update/suite.rc b/tests/runahead/release-update/suite.rc index 5425a1e26f2..5fea12bd77d 100644 --- a/tests/runahead/release-update/suite.rc +++ b/tests/runahead/release-update/suite.rc @@ -1,8 +1,5 @@ [cylc] cycle point format = %Y - [[events]] - inactivity = PT1M - abort on inactivity = True [scheduling] initial cycle point = now final cycle point = +P1Y @@ -16,4 +13,4 @@ """ # (or sequential bar) [runtime] [[root]] - script = /bin/true + script = true diff --git a/tests/shutdown/00-cycle/suite.rc b/tests/shutdown/00-cycle/suite.rc index 36000e3ea83..303bb8a8f89 100644 --- a/tests/shutdown/00-cycle/suite.rc +++ b/tests/shutdown/00-cycle/suite.rc @@ -1,7 +1,5 @@ [cylc] UTC mode = True - [[reference test]] - live mode suite timeout = PT50S [scheduling] initial cycle point = 20100101T00 final cycle point = 20100105T00 diff --git a/tests/shutdown/01-task/suite.rc b/tests/shutdown/01-task/suite.rc index 95585f30606..5b234230e85 100644 --- a/tests/shutdown/01-task/suite.rc +++ b/tests/shutdown/01-task/suite.rc @@ -1,7 +1,5 @@ [cylc] UTC mode = True - [[reference test]] - live mode suite timeout = PT50S [scheduling] initial cycle point = 20100101T00 final cycle point = 20100105T00 diff --git a/tests/shutdown/04-kill/suite.rc b/tests/shutdown/04-kill/suite.rc index 9b209ce5504..944a7c82afa 100644 --- a/tests/shutdown/04-kill/suite.rc +++ b/tests/shutdown/04-kill/suite.rc @@ -1,8 +1,6 @@ [cylc] [[reference test]] expected task failures = t1.1 - required run mode = live - live mode suite timeout = PT30S [scheduling] [[graph]] diff --git a/tests/shutdown/07-task-fail/suite.rc b/tests/shutdown/07-task-fail/suite.rc index 8dddde353ac..acde88a8280 100644 --- a/tests/shutdown/07-task-fail/suite.rc +++ b/tests/shutdown/07-task-fail/suite.rc @@ -1,6 +1,6 @@ [cylc] - abort if any task fails = True [[events]] + abort if any task fails = True abort on timeout = True timeout = PT1M diff --git a/tests/shutdown/08-now1/suite.rc b/tests/shutdown/08-now1/suite.rc index 772a42a59b2..c72a003c801 100644 --- a/tests/shutdown/08-now1/suite.rc +++ b/tests/shutdown/08-now1/suite.rc @@ -1,7 +1,8 @@ [cylc] [[events]] - abort on timeout = True - timeout = PT1M + abort on stalled = True + abort on inactivity = True + inactivity = PT3M [scheduling] [[graph]] diff --git a/tests/shutdown/12-bad-port-file-check/suite.rc b/tests/shutdown/12-bad-port-file-check/suite.rc index e362fd06c80..98f591c6fa0 100644 --- a/tests/shutdown/12-bad-port-file-check/suite.rc +++ b/tests/shutdown/12-bad-port-file-check/suite.rc @@ -1,10 +1,10 @@ #!Jinja2 [cylc] - abort if any task fails = True {% if GLOBALCFG is not defined %} health check interval = PT10S {% endif %}{# not GLOBALCFG is not defined #} [[events]] + abort if any task fails = True abort on stalled = False abort on timeout = True timeout = PT1M diff --git a/tests/shutdown/13-no-port-file-check/suite.rc b/tests/shutdown/13-no-port-file-check/suite.rc index 0603653be66..f1e83c1aa77 100644 --- a/tests/shutdown/13-no-port-file-check/suite.rc +++ b/tests/shutdown/13-no-port-file-check/suite.rc @@ -3,8 +3,8 @@ {% if GLOBALCFG is not defined %} health check interval = PT10S {% endif %}{# not GLOBALCFG is not defined #} - abort if any task fails = True [[events]] + abort if any task fails = True abort on stalled = False abort on timeout = True timeout = PT1M diff --git a/tests/shutdown/14-no-dir-check/suite.rc b/tests/shutdown/14-no-dir-check/suite.rc index b5db13edb28..361db09ea5c 100644 --- a/tests/shutdown/14-no-dir-check/suite.rc +++ b/tests/shutdown/14-no-dir-check/suite.rc @@ -1,10 +1,10 @@ #!Jinja2 [cylc] - abort if any task fails = True {% if GLOBALCFG is not defined %} health check interval = PT10S {% endif %}{# not GLOBALCFG is not defined #} [[events]] + abort if any task fails = True abort on stalled = False abort on timeout = True timeout = PT1M diff --git a/tests/shutdown/18-client-on-dead-suite.t b/tests/shutdown/18-client-on-dead-suite.t index 6f3ba68861b..0bac5b4fbae 100755 --- a/tests/shutdown/18-client-on-dead-suite.t +++ b/tests/shutdown/18-client-on-dead-suite.t @@ -15,10 +15,16 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . #------------------------------------------------------------------------------- -# Test suite shuts down with error on missing port file +# Test suite shuts down with error on missing contact file +# And correct behaviour with client on the next 2 connection attempts. . "$(dirname "$0")/test_header" set_test_number 5 init_suite "${TEST_NAME_BASE}" <<'__SUITERC__' +[cylc] + [[events]] + abort on stalled = True + abort on inactivity = True + inactivity = PT3M [scheduling] [[graph]] R1 = t1 @@ -31,6 +37,7 @@ run_ok "${TEST_NAME_BASE}-validate" cylc validate "${SUITE_NAME}" cylc run --hold --no-detach "${SUITE_NAME}" 1>'cylc-run.out' 2>&1 & MYPID=$! RUND="$(cylc get-global-config --print-run-dir)/${SUITE_NAME}" +poll '!' test -d "${RUND}/.service" poll '!' test -f "${RUND}/.service/contact" kill "${MYPID}" # Should leave behind the contact file wait "${MYPID}" 1>'/dev/null' 2>&1 || true diff --git a/tests/shutdown/19-log-reference.t b/tests/shutdown/19-log-reference.t index 51eee54749a..06e069ea3b8 100755 --- a/tests/shutdown/19-log-reference.t +++ b/tests/shutdown/19-log-reference.t @@ -17,11 +17,15 @@ #------------------------------------------------------------------------------- # Test suite shuts down with reference log, specifically that there is no # issue in the shutdown method when the --reference-log option is used. -. $(dirname $0)/test_header +. "$(dirname "$0")/test_header" #------------------------------------------------------------------------------- -set_test_number 1 +set_test_number 3 #------------------------------------------------------------------------------- init_suite "${TEST_NAME_BASE}" <<'__SUITERC__' +[cylc] + [[events]] + abort on inactivity = True + inactivity = PT3M [scheduling] [[graph]] R1 = t1 @@ -30,7 +34,11 @@ init_suite "${TEST_NAME_BASE}" <<'__SUITERC__' script = true __SUITERC__ #------------------------------------------------------------------------------- -TEST_NAME=$TEST_NAME_BASE-run -suite_run_ok $TEST_NAME timeout 60s cylc run --debug --no-detach --reference-log $SUITE_NAME +suite_run_ok "${TEST_NAME_BASE}-run-reflog" \ + cylc run --debug --no-detach --reference-log "${SUITE_NAME}" +exists_ok 'reference.log' +suite_run_ok "${TEST_NAME_BASE}-run-reftest" \ + cylc run --debug --no-detach --reference-test "${SUITE_NAME}" #------------------------------------------------------------------------------- purge_suite "${SUITE_NAME}" +exit diff --git a/tests/spawn-max/00-basic/suite.rc b/tests/spawn-max/00-basic/suite.rc index 6138258d464..f71be12fe40 100644 --- a/tests/spawn-max/00-basic/suite.rc +++ b/tests/spawn-max/00-basic/suite.rc @@ -1,7 +1,6 @@ [cylc] cycle point format = %Y [[reference test]] - live mode suite timeout = PT1M expected task failures = get_obs.2010 [scheduling] initial cycle point = 2010 diff --git a/tests/special/exclude/suite.rc b/tests/special/exclude/suite.rc index d0a3fbb6f3e..fc9425a67f2 100644 --- a/tests/special/exclude/suite.rc +++ b/tests/special/exclude/suite.rc @@ -1,7 +1,3 @@ -[cylc] - [[reference test]] - required run mode = live - live mode suite timeout = PT30S [scheduling] [[special tasks]] exclude at start-up = "exclude" # should not run diff --git a/tests/special/include/suite.rc b/tests/special/include/suite.rc index 43eb8a2cd83..4f4e31de204 100644 --- a/tests/special/include/suite.rc +++ b/tests/special/include/suite.rc @@ -1,7 +1,3 @@ -[cylc] - [[reference test]] - required run mode = live - live mode suite timeout = PT30S [scheduling] [[special tasks]] include at start-up = "include" # should be only task run diff --git a/tests/special/sequential/suite.rc b/tests/special/sequential/suite.rc index 2671a6e6cd0..bec1a00906b 100644 --- a/tests/special/sequential/suite.rc +++ b/tests/special/sequential/suite.rc @@ -1,8 +1,5 @@ [cylc] cycle point format = %Y%m%dT%H - [[reference test]] - required run mode = live - live mode suite timeout = PT2M [scheduling] initial cycle point = 20100101T00 final cycle point = 20100101T18 diff --git a/tests/suite-host-self-id/00-address.t b/tests/suite-host-self-id/00-address.t index 7e939bdddfb..70c65d97c63 100644 --- a/tests/suite-host-self-id/00-address.t +++ b/tests/suite-host-self-id/00-address.t @@ -41,7 +41,7 @@ create_test_globalrc '' ' [suite host self-identification] method = address' suite_run_ok "${TEST_NAME_BASE}-run" \ - timeout 60 cylc run --reference-test --debug --no-detach "${SUITE_NAME}" \ + cylc run --reference-test --debug --no-detach "${SUITE_NAME}" \ "--set=MY_HOST_IP=${MY_HOST_IP}" #------------------------------------------------------------------------------- diff --git a/tests/suite-host-self-id/00-address/suite.rc b/tests/suite-host-self-id/00-address/suite.rc index f495653f1a5..e613e22b4ae 100644 --- a/tests/suite-host-self-id/00-address/suite.rc +++ b/tests/suite-host-self-id/00-address/suite.rc @@ -1,13 +1,4 @@ #!Jinja2 -[cylc] - UTC mode = True - [[events]] - abort on stalled = True - abort on inactivity = True - inactivity = PT1M - [[reference test]] - required run mode = live - live mode suite timeout = PT1M [scheduling] [[graph]] R1 = t1 @@ -16,5 +7,3 @@ script = """ grep -F -q "CYLC_SUITE_HOST={{MY_HOST_IP}}" "${CYLC_SUITE_RUN_DIR}/.service/contact" """ - [[[job]]] - execution time limit = PT30S diff --git a/tests/suite-state/format/suite.rc b/tests/suite-state/format/suite.rc index bd87bd7f6b0..84ccd865335 100644 --- a/tests/suite-state/format/suite.rc +++ b/tests/suite-state/format/suite.rc @@ -1,8 +1,6 @@ [cylc] UTC mode = True cycle point format = CCYY-MM-DD - [[reference test]] - live mode suite timeout = PT1M [scheduling] initial cycle point = 20100101 diff --git a/tests/suite-state/message/suite.rc b/tests/suite-state/message/suite.rc index fcbc239550f..f16a59afd59 100644 --- a/tests/suite-state/message/suite.rc +++ b/tests/suite-state/message/suite.rc @@ -1,7 +1,5 @@ [cylc] UTC mode = True - [[reference test]] - live mode suite timeout = PT1M [scheduling] initial cycle point = 20100101T0000Z diff --git a/tests/suite-state/options/suite.rc b/tests/suite-state/options/suite.rc index beae2d93098..668c9ce1d5e 100644 --- a/tests/suite-state/options/suite.rc +++ b/tests/suite-state/options/suite.rc @@ -1,8 +1,6 @@ #!jinja2 [cylc] UTC mode = True - [[reference test]] - live mode suite timeout = PT1M [scheduling] initial cycle point = 20100101T00Z final cycle point = 20100103T00Z diff --git a/tests/suite-state/polling/suite.rc b/tests/suite-state/polling/suite.rc index 05e6d65b40a..5553f7c0b27 100644 --- a/tests/suite-state/polling/suite.rc +++ b/tests/suite-state/polling/suite.rc @@ -2,9 +2,6 @@ [meta] title = "polls for success and failure tasks in another suite" -[cylc] - [[reference test]] - live mode suite timeout = PT1M [scheduling] [[graph]] R1 = """ diff --git a/tests/suite-state/template/suite.rc b/tests/suite-state/template/suite.rc index 43883458eec..66c101531e6 100644 --- a/tests/suite-state/template/suite.rc +++ b/tests/suite-state/template/suite.rc @@ -1,8 +1,6 @@ #!jinja2 [cylc] UTC mode = True - [[reference test]] - live mode suite timeout = PT1M [scheduling] initial cycle point = 20100101T0000Z final cycle point = 20110101T0000Z diff --git a/tests/suite-state/template_ref/suite.rc b/tests/suite-state/template_ref/suite.rc index 8160d2869eb..fd56242b0e6 100644 --- a/tests/suite-state/template_ref/suite.rc +++ b/tests/suite-state/template_ref/suite.rc @@ -1,8 +1,6 @@ [cylc] UTC mode = True cycle point format = %Y - [[reference test]] - live mode suite timeout = PT1M [scheduling] initial cycle point = 2010 diff --git a/tests/suite-state/upstream/suite.rc b/tests/suite-state/upstream/suite.rc index ad04fa4aa2d..95b7279fb86 100644 --- a/tests/suite-state/upstream/suite.rc +++ b/tests/suite-state/upstream/suite.rc @@ -1,8 +1,6 @@ [meta] title = "One task takes 20 sec to succeed, another to fail, another to send a message." -[cylc] - [[reference test]] - live mode suite timeout = PT10M + [scheduling] [[graph]] R1 = """ diff --git a/tests/task-name/00-basic/suite.rc b/tests/task-name/00-basic/suite.rc index 5080e2efbc2..af9772697bc 100644 --- a/tests/task-name/00-basic/suite.rc +++ b/tests/task-name/00-basic/suite.rc @@ -1,8 +1,5 @@ [cylc] UTC mode = True - [[reference test]] - required run mode = live - live mode suite timeout = PT1M [scheduling] initial cycle point = 20150101 final cycle point = 20200101 diff --git a/tests/triggering/fail/suite.rc b/tests/triggering/fail/suite.rc index c5d4dd43d69..4b68a1b311b 100644 --- a/tests/triggering/fail/suite.rc +++ b/tests/triggering/fail/suite.rc @@ -1,8 +1,5 @@ [cylc] [[reference test]] - required run mode = live - live mode suite timeout = PT30S - allow task failures = True expected task failures = foo.1 [scheduling] diff --git a/tests/triggering/fam-fail-all/suite.rc b/tests/triggering/fam-fail-all/suite.rc index 603c50c9866..bae1ce4fcd8 100644 --- a/tests/triggering/fam-fail-all/suite.rc +++ b/tests/triggering/fam-fail-all/suite.rc @@ -1,8 +1,5 @@ [cylc] [[reference test]] - required run mode = live - live mode suite timeout = PT30S - allow task failures = True expected task failures = a.1, b.1, c.1 [scheduling] diff --git a/tests/triggering/fam-fail-any/suite.rc b/tests/triggering/fam-fail-any/suite.rc index 474a1441b6c..54f0ab62091 100644 --- a/tests/triggering/fam-fail-any/suite.rc +++ b/tests/triggering/fam-fail-any/suite.rc @@ -1,8 +1,5 @@ [cylc] [[reference test]] - required run mode = live - live mode suite timeout = PT30S - allow task failures = True expected task failures = b.1 [scheduling] diff --git a/tests/triggering/fam-finish-all/suite.rc b/tests/triggering/fam-finish-all/suite.rc index bd01f978746..9405e330dd0 100644 --- a/tests/triggering/fam-finish-all/suite.rc +++ b/tests/triggering/fam-finish-all/suite.rc @@ -1,8 +1,5 @@ [cylc] [[reference test]] - required run mode = live - live mode suite timeout = PT30S - allow task failures = True expected task failures = a.1, c.1 [scheduling] diff --git a/tests/triggering/fam-finish-any/suite.rc b/tests/triggering/fam-finish-any/suite.rc index 02cda28751a..d5a4fad407c 100644 --- a/tests/triggering/fam-finish-any/suite.rc +++ b/tests/triggering/fam-finish-any/suite.rc @@ -1,8 +1,3 @@ -[cylc] - [[reference test]] - required run mode = live - live mode suite timeout = PT30S - [scheduling] [[graph]] R1 = """FAM:finish-any => foo""" diff --git a/tests/triggering/fam-start-all/suite.rc b/tests/triggering/fam-start-all/suite.rc index 68d0420ea74..cfa8a5f2191 100644 --- a/tests/triggering/fam-start-all/suite.rc +++ b/tests/triggering/fam-start-all/suite.rc @@ -1,8 +1,3 @@ -[cylc] - [[reference test]] - required run mode = live - live mode suite timeout=PT1M - [scheduling] [[graph]] R1 = """FAM:start-all => foo""" diff --git a/tests/triggering/fam-succeed-all/suite.rc b/tests/triggering/fam-succeed-all/suite.rc index dce4023fbf5..18a7fad63f1 100644 --- a/tests/triggering/fam-succeed-all/suite.rc +++ b/tests/triggering/fam-succeed-all/suite.rc @@ -1,8 +1,3 @@ -[cylc] - [[reference test]] - required run mode = live - live mode suite timeout = PT30S - [scheduling] [[graph]] R1 = """FAM:succeed-all => foo""" diff --git a/tests/triggering/fam-succeed-any/suite.rc b/tests/triggering/fam-succeed-any/suite.rc index fb511d5b243..a27bc041331 100644 --- a/tests/triggering/fam-succeed-any/suite.rc +++ b/tests/triggering/fam-succeed-any/suite.rc @@ -1,8 +1,5 @@ [cylc] [[reference test]] - required run mode = live - live mode suite timeout = PT30S - allow task failures = True expected task failures = a.1, c.1 [scheduling] diff --git a/tests/triggering/finish/suite.rc b/tests/triggering/finish/suite.rc index dc1e44dabdc..9bb2f6573b5 100644 --- a/tests/triggering/finish/suite.rc +++ b/tests/triggering/finish/suite.rc @@ -1,8 +1,5 @@ [cylc] [[reference test]] - required run mode = live - live mode suite timeout = PT30S - allow task failures = True expected task failures = foo.1 [scheduling] @@ -12,6 +9,6 @@ baz:finish => qux""" [runtime] [[foo]] - script = "false" + script = false [[bar,baz,qux]] script = "true" diff --git a/tests/triggering/or-condition/suite.rc b/tests/triggering/or-condition/suite.rc index 393135e5ad2..1c88f1754b4 100644 --- a/tests/triggering/or-condition/suite.rc +++ b/tests/triggering/or-condition/suite.rc @@ -1,8 +1,3 @@ -[cylc] - [[reference test]] - required run mode = live - live mode suite timeout=PT1M - [scheduling] [[graph]] R1 = """a | b => c & d diff --git a/tests/triggering/recovery/suite.rc b/tests/triggering/recovery/suite.rc index 8e81a3ea5e8..b4144f9ef96 100644 --- a/tests/triggering/recovery/suite.rc +++ b/tests/triggering/recovery/suite.rc @@ -9,7 +9,6 @@ [cylc] UTC mode = True [[reference test]] - live mode suite timeout = PT50S expected task failures = model.20110101T1200Z [scheduling] diff --git a/tests/triggering/start/suite.rc b/tests/triggering/start/suite.rc index c6dfb074620..1febe1a044d 100644 --- a/tests/triggering/start/suite.rc +++ b/tests/triggering/start/suite.rc @@ -1,8 +1,3 @@ -[cylc] - [[reference test]] - required run mode = live - live mode suite timeout = PT30S - [scheduling] [[graph]] R1 = "foo:start => bar" diff --git a/tests/triggering/submit-fail/suite.rc b/tests/triggering/submit-fail/suite.rc index 19ba99b972f..ee4f6fcd1db 100644 --- a/tests/triggering/submit-fail/suite.rc +++ b/tests/triggering/submit-fail/suite.rc @@ -1,8 +1,5 @@ [cylc] [[reference test]] - required run mode = live - live mode suite timeout = PT30S - allow task failures = True expected task failures = foo.1 [scheduling] diff --git a/tests/triggering/submit/suite.rc b/tests/triggering/submit/suite.rc index e8b442349e9..ec490b9a1d0 100644 --- a/tests/triggering/submit/suite.rc +++ b/tests/triggering/submit/suite.rc @@ -1,8 +1,3 @@ -[cylc] - [[reference test]] - required run mode = live - live mode suite timeout = PT30S - [scheduling] [[graph]] R1 = "foo:submit => bar" diff --git a/tests/triggering/succeed/suite.rc b/tests/triggering/succeed/suite.rc index 7116ece43da..ca8659bfcb2 100644 --- a/tests/triggering/succeed/suite.rc +++ b/tests/triggering/succeed/suite.rc @@ -1,8 +1,3 @@ -[cylc] - [[reference test]] - required run mode = live - live mode suite timeout = PT30S - [scheduling] [[graph]] R1 = "foo:succeed => bar" diff --git a/tests/triggering/suicide/suite.rc b/tests/triggering/suicide/suite.rc index bc2640cb857..ae7cc82459a 100644 --- a/tests/triggering/suicide/suite.rc +++ b/tests/triggering/suicide/suite.rc @@ -2,8 +2,6 @@ title = "Hello, Goodbye, Suicide" [cylc] [[reference test]] - required run mode = live - live mode suite timeout = PT1M expected task failures = goodbye.1 [scheduling] diff --git a/tests/validate/00-multi/suite.rc b/tests/validate/00-multi/suite.rc index b8a6fc12bef..df12c88357d 100644 --- a/tests/validate/00-multi/suite.rc +++ b/tests/validate/00-multi/suite.rc @@ -3,10 +3,6 @@ description = """Bug identified at 5.1.1-314-g4960684.""" -[cylc] -[[reference test]] -required run mode = live -live mode suite timeout = PT1M [scheduling] [[graph]] R1 = """foo""" diff --git a/tests/validate/01-periodical/suite.rc b/tests/validate/01-periodical/suite.rc index 60467a05f1f..770593794ab 100644 --- a/tests/validate/01-periodical/suite.rc +++ b/tests/validate/01-periodical/suite.rc @@ -1,7 +1,3 @@ -[cylc] - [[reference test]] - required run mode = live - live mode suite timeout = PT1M [scheduling] initial cycle point = 20100101T00 final cycle point = 20100102T00 diff --git a/tests/validate/24-fail-initial-greater-final/suite.rc b/tests/validate/24-fail-initial-greater-final/suite.rc index c710142654d..13b3cdf330b 100644 --- a/tests/validate/24-fail-initial-greater-final/suite.rc +++ b/tests/validate/24-fail-initial-greater-final/suite.rc @@ -6,9 +6,7 @@ error.""" [cylc] UTC mode = True - [[reference test]] - required run mode = live - + [scheduling] initial cycle point = 20141208T0000Z final cycle point = 20141207T0000Z diff --git a/tests/validate/31-fail-not-integer.t b/tests/validate/31-fail-not-integer.t index cbe3cf649d2..d341238c57e 100755 --- a/tests/validate/31-fail-not-integer.t +++ b/tests/validate/31-fail-not-integer.t @@ -34,7 +34,6 @@ __SUITERC__ #------------------------------------------------------------------------------- TEST_NAME="${TEST_NAME_BASE}" run_fail "${TEST_NAME}" cylc validate -v 'suite.rc' -cat "${TEST_NAME}.stderr" >&2 grep_ok "SuiteConfigError: Cannot process recurrence 1" "${TEST_NAME}.stderr" #------------------------------------------------------------------------------- exit