-
Notifications
You must be signed in to change notification settings - Fork 95
tests/f: fix remote tests & improve portability #6882
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
ec80eb7
db78dd2
afe6ff3
4ba34dd
e9457ed
883f0e1
5860116
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,15 +9,29 @@ | |
|
|
||
| [scheduling] | ||
| [[graph]] | ||
| R1 = local-task:echo & remote-task:echo => cat-log | ||
| R1 = """ | ||
| # start "local-task" and "remote-task", then run cat-log | ||
| local-task:echo & remote-task:echo => cat-log | ||
|
|
||
| # add a downstream task to ensure "local-task" and "remote-task" | ||
| # succeed (for the reference test) | ||
| local-task & remote-task => fin | ||
| """ | ||
|
|
||
| [runtime] | ||
| [[ECHO]] | ||
wxtim marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| script = """ | ||
| cylc__job__wait_cylc_message_started | ||
| echo rubbish | ||
| echo garbage >&2 | ||
| cylc message 'echo done' | ||
| cylc message -- 'echo done' | ||
| # wait up to PT1M for the cat-log task to succeed | ||
| # (the workflow will shut down if cat-log fails) | ||
| sleep 60 | ||
| # fail if the task was not orphaned by this point | ||
| false | ||
|
Comment on lines
+27
to
+34
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test was supposed to be testing
However, there was nothing to keep the task running, so it was actually testing succeeded jobs. I've changed the approach, the tasks now sleep for 60s, then fail. If the
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I went back to an early version of this test, and it used to have
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Matt did purposefully try to pull out sleeps from the tests in order to speed them up reduce flakyness. It might have vanished then. In this particular case, the sleep is ok, but it could have easily been mistaken. |
||
| """ | ||
| [[[outputs]]] | ||
| echo = "echo done" | ||
|
|
@@ -26,15 +40,20 @@ | |
| [[remote-task]] | ||
| platform = {{ environ['CYLC_TEST_PLATFORM'] }} | ||
| inherit = ECHO | ||
|
|
||
| [[cat-log]] | ||
| script = """ | ||
| cylc__job__wait_cylc_message_started | ||
| for TASK in '1/local-task' '1/remote-task'; do | ||
| cylc cat-log --debug -f o \ | ||
| "${CYLC_WORKFLOW_ID}//${TASK}" \ | ||
| | grep 'rubbish' | ||
| cylc cat-log --debug -f e \ | ||
| "${CYLC_WORKFLOW_ID}//${TASK}" \ | ||
| | grep 'garbage' | ||
| # orphan the sleep command | ||
| cylc set "${CYLC_WORKFLOW_ID}//${TASK}" | ||
| done | ||
| """ | ||
|
|
||
| [[fin]] | ||
| run mode = skip | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,20 +1,29 @@ | ||
| #!Jinja2 | ||
|
|
||
| [scheduler] | ||
| UTC mode = True | ||
| [[events]] | ||
| expected task failures = 1/local-fail-1, 1/local-fail-2, 1/remote-fail-1 | ||
|
|
||
| [scheduling] | ||
| [[graph]] | ||
| R1 = """ | ||
| POLLABLE:start-all => poller | ||
| POLLABLE:succeed-any # (make member success optional) | ||
| """ | ||
|
|
||
| [runtime] | ||
| # turn off error trapping to disable "cylc message" calls | ||
| # (this prevents the "succeeded" / "failed" messages getting through) | ||
| [[POLLABLE]] | ||
| init-script = cylc__job__disable_fail_signals ERR EXIT | ||
|
|
||
| # these tasks will fail (but not send the failed message or write it to the | ||
| # job.status file) | ||
| [[FAIL]] | ||
| inherit = POLLABLE | ||
| script = """ | ||
| cylc__job__wait_cylc_message_started | ||
| echo 'I am failing...' >&2 | ||
| exit 1 | ||
| """ | ||
|
|
@@ -23,9 +32,13 @@ | |
| [[remote-fail-1]] | ||
| inherit = FAIL | ||
| platform = {{ environ['CYLC_TEST_PLATFORM'] }} | ||
|
|
||
| # these tasks will succeed (but not send the succeeded message or write it | ||
| # to the job.status file) | ||
| [[SUCCESS]] | ||
| inherit = POLLABLE | ||
| script = """ | ||
| cylc__job__wait_cylc_message_started | ||
| echo 'I am OK.' | ||
| { | ||
| echo 'CYLC_JOB_EXIT=SUCCEEDED' | ||
|
|
@@ -38,8 +51,18 @@ | |
| [[remote-success-1, remote-success-2]] | ||
| inherit = SUCCESS | ||
| platform = {{ environ['CYLC_TEST_PLATFORM'] }} | ||
|
|
||
| # this task will poll the active jobs and hopefully detect their | ||
| # success / failure | ||
| [[poller]] | ||
| script = """ | ||
| # give a bit of grace time for the job to leave the job runner queue | ||
| sleep 5 | ||
|
Comment on lines
+59
to
+60
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unavoidable sleep :( Give PBS a grace period to remove the finished job from the queue before attempting to poll. This failed reliably yesterday, but passed flakily today. Looks like the required grace period is fairly small. |
||
| # poll the job (it should change to a final state) | ||
| cylc poll "${CYLC_WORKFLOW_ID}//*/POLLABLE" | ||
| # shut down the scheduler (there should not be any active tasks | ||
| # left to delay shutdown) | ||
| cylc stop "${CYLC_WORKFLOW_ID}" | ||
| """ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,12 +27,12 @@ create_test_global_config '' " | |
| [platforms] | ||
| [[_retrieve]] | ||
| $(cylc config -i "[platforms][$CYLC_TEST_PLATFORM]") | ||
| [[_retrieve]] | ||
| retrieve job logs = True | ||
| install target = $CYLC_TEST_PLATFORM | ||
| [[_no_retrieve]] | ||
| $(cylc config -i "[platforms][$CYLC_TEST_PLATFORM]") | ||
| [[_no_retrieve]] | ||
| retrieve job logs = False | ||
| install target = $CYLC_TEST_PLATFORM | ||
| " | ||
|
Comment on lines
28
to
36
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
|
||
| run_ok "${TEST_NAME_BASE}-validate" \ | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make symlink dir issues easier to debug.