#!Jinja2
{% set HOST = environ['CYLC_TEST_BATCH_TASK_HOST'] %}
{% 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]
    [[dependencies]]
        graph = """rem1 => rem2
                   rem2:start => killer => !rem2
                   """
[runtime]
    [[LLSETTINGS]]
        [[[job]]]
            batch system = loadleveler
        [[[directives]]]
            class            = serial
            job_type         = serial
            notification     = error
            wall_clock_limit = '120,60'
            {{SITE_DIRECTIVES}}
        [[[remote]]]
            host = {{ HOST }}
    [[rem1]]
        inherit = LLSETTINGS
        script = "sleep 10; true"
    [[rem2]]
        inherit = LLSETTINGS
        script = "sleep 30"
    [[killer]]
        script = cylc kill -f "$CYLC_SUITE_NAME" 'rem2'; sleep 10
