File: test_worker_failure.py

package info (click to toggle)
python-parsl 2025.01.13%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 12,072 kB
  • sloc: python: 23,817; makefile: 349; sh: 276; ansic: 45
file content (26 lines) | stat: -rw-r--r-- 603 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import pytest

from parsl.app.app import python_app
from parsl.executors.high_throughput.errors import WorkerLost


def local_config():
    from parsl.tests.configs.htex_local import fresh_config
    config = fresh_config()
    config.executors[0].poll_period = 1
    config.executors[0].max_workers_per_node = 1
    config.executors[0].heartbeat_period = 1
    return config


@python_app
def kill_worker():
    raise SystemExit(2)


@pytest.mark.local
def test_htex_worker_failures():
    for _ in range(3):
        with pytest.raises(WorkerLost):
            f = kill_worker()
            f.result()