| 1 |
.. _text_based_def_time: |
| 2 |
|
| 3 |
time |
| 4 |
//// |
| 5 |
|
| 6 |
This defines a time dependency for a node. Time is expressed in the |
| 7 |
format **[h]h:mm** . Only numeric values are allowed. There can be |
| 8 |
multiple time dependencies for a node, but overlapping times may cause |
| 9 |
unexpected results. |
| 10 |
|
| 11 |
.. note:: |
| 12 |
|
| 13 |
Long running Tasks might overrun the next execution slot, and when this happens the execution automatically skips |
| 14 |
to the following slot. |
| 15 |
|
| 16 |
To avoid overruning execution slots, instead of a :code:`time` dependency consider specifyting a time-based trigger. |
| 17 |
See :ref:`tutorial-time-triggers` for details. |
| 18 |
|
| 19 |
|
| 20 |
To define a series of times, specify the start time, end time and a time |
| 21 |
increment. |
| 22 |
|
| 23 |
If the start time begins with \`+', times are relative to the beginning |
| 24 |
of the suite or, in repeated families, relative to the beginning of the |
| 25 |
repeated family. |
| 26 |
|
| 27 |
If relative times are being used, the end time is also relative. |
| 28 |
|
| 29 |
.. code-block:: shell |
| 30 |
|
| 31 |
time 15:00 # at 15:00 |
| 32 |
time 10:00 20:00 01:00 # every hour from 10am to 8pm |
| 33 |
time +00:01 # one minute after the suite begins, or one minute after re-queue in the presence of Repeat. |
| 34 |
time +00:10 01:00 00:05 # 10-60 min after begin/re-queue, every 5 min |
| 35 |
|
| 36 |
There is no direct way to specify that a node should be submitted on |
| 37 |
different days at different times. To get a task to run at two specific |
| 38 |
times you can use two separate time commands. |
| 39 |
|
| 40 |
.. code-block:: shell |
| 41 |
|
| 42 |
task t1 |
| 43 |
time 15:00 # run at 15:00 |
| 44 |
time 19:00 # also run at 19:00 |
| 45 |
|
| 46 |
.. warning:: |
| 47 |
|
| 48 |
Beware that tasks using a :code:`time` dependency may cause the Suite to cycle on fast systems. |
| 49 |
|
| 50 |
If a task takes less than a minute to run then there is a possibility that the trigger will still be |
| 51 |
valid once the suite has cycled. |
| 52 |
|
| 53 |
Avoid this by ensuring that such tasks take longer than one minute to run (e.g. using the :code:`sleep` command). |