Skip to content

Commit e1e4bd1

Browse files
authored
Test correct increase in dep_fail count (#4003)
(These counts are not generally tested, but this PR is not introducing a general tests for them; instead it is about testing dependency handling behaviour more - based on regressions encountered during development of adjacent PRs) # Changed Behaviour none ## Type of change - Code maintenance/cleanup
1 parent e732153 commit e1e4bd1

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

parsl/tests/test_python_apps/test_depfail_propagation.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
import parsl
12
from parsl import python_app
23
from parsl.dataflow.errors import DependencyError
4+
from parsl.dataflow.states import States
35

46

57
@python_app
@@ -14,6 +16,7 @@ def depends(parent):
1416

1517
def test_depfail_once():
1618
"""Test the simplest dependency failure case"""
19+
start_dep_fail_count = parsl.dfk().task_state_counts[States.dep_fail]
1720
f1 = fails()
1821
f2 = depends(f1)
1922

@@ -25,9 +28,12 @@ def test_depfail_once():
2528
# in the DependencyError message
2629
assert ("task " + str(f1.task_record['id'])) in str(f2.exception())
2730

31+
assert parsl.dfk().task_state_counts[States.dep_fail] == start_dep_fail_count + 1
32+
2833

2934
def test_depfail_chain():
3035
"""Test that dependency failures chain"""
36+
start_dep_fail_count = parsl.dfk().task_state_counts[States.dep_fail]
3137
f1 = fails()
3238
f2 = depends(f1)
3339
f3 = depends(f2)
@@ -39,11 +45,13 @@ def test_depfail_chain():
3945
assert isinstance(f3.exception(), DependencyError)
4046
assert isinstance(f4.exception(), DependencyError)
4147

48+
assert parsl.dfk().task_state_counts[States.dep_fail] == start_dep_fail_count + 3
49+
4250

4351
def test_depfail_branches():
4452
"""Test that dependency failures propagate in the
4553
presence of multiple downstream tasks."""
46-
54+
start_dep_fail_count = parsl.dfk().task_state_counts[States.dep_fail]
4755
f1 = fails()
4856
f2 = depends(f1)
4957
f3 = depends(f1)
@@ -52,3 +60,5 @@ def test_depfail_branches():
5260
assert not isinstance(f1.exception(), DependencyError)
5361
assert isinstance(f2.exception(), DependencyError)
5462
assert isinstance(f3.exception(), DependencyError)
63+
64+
assert parsl.dfk().task_state_counts[States.dep_fail] == start_dep_fail_count + 2

0 commit comments

Comments
 (0)