1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
import pytest
import parsl
from parsl.app.app import bash_app
from parsl.app.errors import AppTimeout
from parsl.tests.configs.local_threads import config
@bash_app
def echo_to_file(inputs=(), outputs=(), walltime=0.01):
return """echo "sleeping"; sleep 0.05"""
def test_walltime():
"""Testing walltime exceeded exception """
x = echo_to_file()
with pytest.raises(AppTimeout):
x.result()
def test_walltime_longer():
"""Test that an app that runs in less than walltime will succeed."""
y = echo_to_file(walltime=0.2)
y.result()
|