parsl 2024.6.10__py3-none-any.whl → 2024.6.24__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- parsl/app/app.py +0 -2
- parsl/app/bash.py +2 -3
- parsl/channels/local/local.py +7 -2
- parsl/configs/ASPIRE1.py +3 -1
- parsl/configs/Azure.py +3 -1
- parsl/configs/ad_hoc.py +2 -0
- parsl/configs/bridges.py +3 -1
- parsl/configs/cc_in2p3.py +2 -0
- parsl/configs/ec2.py +2 -0
- parsl/configs/expanse.py +3 -1
- parsl/configs/frontera.py +2 -0
- parsl/configs/htex_local.py +2 -0
- parsl/configs/illinoiscluster.py +2 -0
- parsl/configs/kubernetes.py +3 -1
- parsl/configs/local_threads.py +5 -1
- parsl/configs/midway.py +2 -0
- parsl/configs/osg.py +3 -1
- parsl/configs/polaris.py +3 -1
- parsl/configs/stampede2.py +2 -0
- parsl/configs/summit.py +2 -0
- parsl/configs/toss3_llnl.py +3 -1
- parsl/configs/vineex_local.py +3 -1
- parsl/configs/wqex_local.py +3 -1
- parsl/executors/high_throughput/executor.py +36 -31
- parsl/executors/high_throughput/interchange.py +5 -8
- parsl/executors/workqueue/executor.py +25 -5
- parsl/providers/kubernetes/kube.py +3 -3
- parsl/tests/test_htex/test_htex.py +24 -7
- parsl/version.py +1 -1
- parsl-2024.6.24.data/scripts/interchange.py +681 -0
- {parsl-2024.6.10.dist-info → parsl-2024.6.24.dist-info}/METADATA +2 -2
- {parsl-2024.6.10.dist-info → parsl-2024.6.24.dist-info}/RECORD +39 -38
- {parsl-2024.6.10.data → parsl-2024.6.24.data}/scripts/exec_parsl_function.py +0 -0
- {parsl-2024.6.10.data → parsl-2024.6.24.data}/scripts/parsl_coprocess.py +0 -0
- {parsl-2024.6.10.data → parsl-2024.6.24.data}/scripts/process_worker_pool.py +0 -0
- {parsl-2024.6.10.dist-info → parsl-2024.6.24.dist-info}/LICENSE +0 -0
- {parsl-2024.6.10.dist-info → parsl-2024.6.24.dist-info}/WHEEL +0 -0
- {parsl-2024.6.10.dist-info → parsl-2024.6.24.dist-info}/entry_points.txt +0 -0
- {parsl-2024.6.10.dist-info → parsl-2024.6.24.dist-info}/top_level.txt +0 -0
@@ -1,11 +1,11 @@
|
|
1
1
|
import pathlib
|
2
2
|
import warnings
|
3
|
+
from subprocess import Popen, TimeoutExpired
|
3
4
|
from unittest import mock
|
4
5
|
|
5
6
|
import pytest
|
6
7
|
|
7
8
|
from parsl import HighThroughputExecutor, curvezmq
|
8
|
-
from parsl.multiprocessing import ForkProcess
|
9
9
|
|
10
10
|
_MOCK_BASE = "parsl.executors.high_throughput.executor"
|
11
11
|
|
@@ -78,16 +78,33 @@ def test_htex_shutdown(
|
|
78
78
|
timeout_expires: bool,
|
79
79
|
htex: HighThroughputExecutor,
|
80
80
|
):
|
81
|
-
mock_ix_proc = mock.Mock(spec=
|
81
|
+
mock_ix_proc = mock.Mock(spec=Popen)
|
82
82
|
|
83
83
|
if started:
|
84
84
|
htex.interchange_proc = mock_ix_proc
|
85
|
-
|
85
|
+
|
86
|
+
# This will, in the absence of any exit trigger, block forever if
|
87
|
+
# no timeout is given and if the interchange does not terminate.
|
88
|
+
# Raise an exception to report that, rather than actually block,
|
89
|
+
# and hope that nothing is catching that exception.
|
90
|
+
|
91
|
+
# this function implements the behaviour if the interchange has
|
92
|
+
# not received a termination call
|
93
|
+
def proc_wait_alive(timeout):
|
94
|
+
if timeout:
|
95
|
+
raise TimeoutExpired(cmd="mock-interchange", timeout=timeout)
|
96
|
+
else:
|
97
|
+
raise RuntimeError("This wait call would hang forever")
|
98
|
+
|
99
|
+
def proc_wait_terminated(timeout):
|
100
|
+
return 0
|
101
|
+
|
102
|
+
mock_ix_proc.wait.side_effect = proc_wait_alive
|
86
103
|
|
87
104
|
if not timeout_expires:
|
88
105
|
# Simulate termination of the Interchange process
|
89
106
|
def kill_interchange(*args, **kwargs):
|
90
|
-
mock_ix_proc.
|
107
|
+
mock_ix_proc.wait.side_effect = proc_wait_terminated
|
91
108
|
|
92
109
|
mock_ix_proc.terminate.side_effect = kill_interchange
|
93
110
|
|
@@ -96,8 +113,8 @@ def test_htex_shutdown(
|
|
96
113
|
mock_logs = mock_logger.info.call_args_list
|
97
114
|
if started:
|
98
115
|
assert mock_ix_proc.terminate.called
|
99
|
-
assert mock_ix_proc.
|
100
|
-
assert {"timeout": 10} == mock_ix_proc.
|
116
|
+
assert mock_ix_proc.wait.called
|
117
|
+
assert {"timeout": 10} == mock_ix_proc.wait.call_args[1]
|
101
118
|
if timeout_expires:
|
102
119
|
assert "Unable to terminate Interchange" in mock_logs[1][0][0]
|
103
120
|
assert mock_ix_proc.kill.called
|
@@ -105,7 +122,7 @@ def test_htex_shutdown(
|
|
105
122
|
assert "Finished" in mock_logs[-1][0][0]
|
106
123
|
else:
|
107
124
|
assert not mock_ix_proc.terminate.called
|
108
|
-
assert not mock_ix_proc.
|
125
|
+
assert not mock_ix_proc.wait.called
|
109
126
|
assert "has not started" in mock_logs[0][0][0]
|
110
127
|
|
111
128
|
|
parsl/version.py
CHANGED