#!Jinja2
{% set HOST = environ['CYLC_TEST_BATCH_TASK_HOST'] %}
{% set SITE_DIRECTIVES = environ['CYLC_TEST_BATCH_SITE_DIRECTIVES'] %}
[cylc]
   [[reference test]]
       expected task failures = rem2.1
[scheduling]
    [[graph]]
        R1 = """rem1 => rem2
                   rem2:start => killer => !rem2
                   """
[runtime]
    [[PBS_SETTINGS]]
        [[[job]]]
            batch system = pbs
        [[[directives]]]
            -l walltime=00:60:00
            -l cput=00:02:00
            {{SITE_DIRECTIVES}}
        [[[remote]]]
            host = {{ HOST }}
    [[rem1]]
        inherit = PBS_SETTINGS
        script = "sleep 10; true"
    [[rem2]]
        inherit = PBS_SETTINGS
        script = "sleep 30"
    [[killer]]
        script = cylc kill -f "$CYLC_SUITE_NAME" 'rem2'; sleep 10
