| 1 |
#!/usr/bin/env bash |
| 2 |
# THIS FILE IS PART OF THE CYLC WORKFLOW ENGINE. |
| 3 |
# Copyright (C) NIWA & British Crown (Met Office) & Contributors. |
| 4 |
# |
| 5 |
# This program is free software: you can redistribute it and/or modify |
| 6 |
# it under the terms of the GNU General Public License as published by |
| 7 |
# the Free Software Foundation, either version 3 of the License, or |
| 8 |
# (at your option) any later version. |
| 9 |
# |
| 10 |
# This program is distributed in the hope that it will be useful, |
| 11 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 |
# GNU General Public License for more details. |
| 14 |
# |
| 15 |
# You should have received a copy of the GNU General Public License |
| 16 |
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 17 |
|
| 18 |
#------------------------------------------------------------------------------ |
| 19 |
# Test that a late job submitted message does not put the task back in the |
| 20 |
# submitted state (it is possible, though unlikely, for the job started |
| 21 |
# message to arrive first). |
| 22 |
|
| 23 |
# Uses a modified background job runner (defined in the workflow source |
| 24 |
# directory) that sleeps before returning after submitting the job. |
| 25 |
|
| 26 |
. "$(dirname "$0")/test_header" |
| 27 |
set_test_number 3 |
| 28 |
|
| 29 |
create_test_global_config "" " |
| 30 |
[platforms] |
| 31 |
[[wobblygibblets]] |
| 32 |
hosts = localhost |
| 33 |
job runner = delayed_background |
| 34 |
install target = localhost |
| 35 |
" |
| 36 |
install_workflow "${TEST_NAME_BASE}" "${TEST_NAME_BASE}" |
| 37 |
run_ok "${TEST_NAME_BASE}-validate" cylc validate "${WORKFLOW_NAME}" |
| 38 |
|
| 39 |
workflow_run_ok "${TEST_NAME_BASE}-run" \ |
| 40 |
cylc play --debug --no-detach "${WORKFLOW_NAME}" |
| 41 |
|
| 42 |
sqlite3 "$RUN_DIR/${WORKFLOW_NAME}/log/db" \ |
| 43 |
'SELECT name, cycle, event from task_events;' >'sqlite3.out' |
| 44 |
|
| 45 |
cmp_ok 'sqlite3.out' <<'__OUT__' |
| 46 |
foo|1|submitted |
| 47 |
foo|1|started |
| 48 |
foo|1|succeeded |
| 49 |
bar|1|submitted |
| 50 |
bar|1|started |
| 51 |
bar|1|succeeded |
| 52 |
__OUT__ |
| 53 |
|
| 54 |
purge |