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.
Files changed (39) hide show
  1. parsl/app/app.py +0 -2
  2. parsl/app/bash.py +2 -3
  3. parsl/channels/local/local.py +7 -2
  4. parsl/configs/ASPIRE1.py +3 -1
  5. parsl/configs/Azure.py +3 -1
  6. parsl/configs/ad_hoc.py +2 -0
  7. parsl/configs/bridges.py +3 -1
  8. parsl/configs/cc_in2p3.py +2 -0
  9. parsl/configs/ec2.py +2 -0
  10. parsl/configs/expanse.py +3 -1
  11. parsl/configs/frontera.py +2 -0
  12. parsl/configs/htex_local.py +2 -0
  13. parsl/configs/illinoiscluster.py +2 -0
  14. parsl/configs/kubernetes.py +3 -1
  15. parsl/configs/local_threads.py +5 -1
  16. parsl/configs/midway.py +2 -0
  17. parsl/configs/osg.py +3 -1
  18. parsl/configs/polaris.py +3 -1
  19. parsl/configs/stampede2.py +2 -0
  20. parsl/configs/summit.py +2 -0
  21. parsl/configs/toss3_llnl.py +3 -1
  22. parsl/configs/vineex_local.py +3 -1
  23. parsl/configs/wqex_local.py +3 -1
  24. parsl/executors/high_throughput/executor.py +36 -31
  25. parsl/executors/high_throughput/interchange.py +5 -8
  26. parsl/executors/workqueue/executor.py +25 -5
  27. parsl/providers/kubernetes/kube.py +3 -3
  28. parsl/tests/test_htex/test_htex.py +24 -7
  29. parsl/version.py +1 -1
  30. parsl-2024.6.24.data/scripts/interchange.py +681 -0
  31. {parsl-2024.6.10.dist-info → parsl-2024.6.24.dist-info}/METADATA +2 -2
  32. {parsl-2024.6.10.dist-info → parsl-2024.6.24.dist-info}/RECORD +39 -38
  33. {parsl-2024.6.10.data → parsl-2024.6.24.data}/scripts/exec_parsl_function.py +0 -0
  34. {parsl-2024.6.10.data → parsl-2024.6.24.data}/scripts/parsl_coprocess.py +0 -0
  35. {parsl-2024.6.10.data → parsl-2024.6.24.data}/scripts/process_worker_pool.py +0 -0
  36. {parsl-2024.6.10.dist-info → parsl-2024.6.24.dist-info}/LICENSE +0 -0
  37. {parsl-2024.6.10.dist-info → parsl-2024.6.24.dist-info}/WHEEL +0 -0
  38. {parsl-2024.6.10.dist-info → parsl-2024.6.24.dist-info}/entry_points.txt +0 -0
  39. {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=ForkProcess)
81
+ mock_ix_proc = mock.Mock(spec=Popen)
82
82
 
83
83
  if started:
84
84
  htex.interchange_proc = mock_ix_proc
85
- mock_ix_proc.is_alive.return_value = True
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.is_alive.return_value = False
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.join.called
100
- assert {"timeout": 10} == mock_ix_proc.join.call_args[1]
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.join.called
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
@@ -3,4 +3,4 @@
3
3
  Year.Month.Day[alpha/beta/..]
4
4
  Alphas will be numbered like this -> 2024.12.10a0
5
5
  """
6
- VERSION = '2024.06.10'
6
+ VERSION = '2024.06.24'