Skip to content

Commit

Permalink
Change heartbeat_period type from float to int
Browse files Browse the repository at this point in the history
  • Loading branch information
rjmello committed Oct 24, 2023
1 parent 9be18ae commit 9ad4812
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Changed
^^^^^^^

- Changed ``heartbeat_period`` type from float to int for ``GlobusComputeEngine``,
``ProcessPoolEngine``, and ``ThreadPoolEngine`` to maintain parity with the
``HighThroughputEngine`` and Parsl's ``HighThroughputExecutor``.
2 changes: 1 addition & 1 deletion compute_endpoint/globus_compute_endpoint/engines/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class GlobusComputeEngineBase(ABC):
def __init__(
self,
*args: object,
heartbeat_period: float = 30.0,
heartbeat_period: int = 30,
endpoint_id: t.Optional[uuid.UUID] = None,
**kwargs: object,
):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def __init__(
*args,
label: str = "GlobusComputeEngine",
address: t.Optional[str] = None,
heartbeat_period: float = 30.0,
heartbeat_period: int = 30,
strategy: t.Optional[SimpleStrategy] = SimpleStrategy(),
executor: t.Optional[HighThroughputExecutor] = None,
**kwargs,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def __init__(
self,
*args,
label: str = "ProcessPoolEngine",
heartbeat_period: float = 30.0,
heartbeat_period: int = 30,
**kwargs,
):
self.label = label
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def __init__(
self,
*args,
label: str = "ThreadPoolEngine",
heartbeat_period: float = 30.0,
heartbeat_period: int = 30,
**kwargs,
):
self.label = label
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def test_no_idle_if_not_configured(mocker, endpoint_uuid, mock_spt):

conf = Config(
executors=[mocker.Mock(endpoint_id=endpoint_uuid)],
heartbeat_period=0.01,
heartbeat_period=1,
idle_heartbeats_soft=0,
)
ei = EndpointInterchange(
Expand All @@ -191,7 +191,7 @@ def test_soft_idle_honored(mocker, endpoint_uuid, mock_spt):

conf = Config(
executors=[mocker.Mock(endpoint_id=endpoint_uuid)],
heartbeat_period=0.1,
heartbeat_period=1,
idle_heartbeats_soft=3,
)
ei = EndpointInterchange(
Expand Down Expand Up @@ -229,7 +229,7 @@ def test_hard_idle_honored(mocker, endpoint_uuid, mock_spt):

conf = Config(
executors=[mocker.Mock(endpoint_id=endpoint_uuid)],
heartbeat_period=0.1,
heartbeat_period=1,
idle_heartbeats_soft=1,
idle_heartbeats_hard=3,
)
Expand Down Expand Up @@ -265,7 +265,7 @@ def test_unidle_updates_proc_title(mocker, endpoint_uuid, mock_spt):

conf = Config(
executors=[mocker.Mock(endpoint_id=endpoint_uuid)],
heartbeat_period=0.1,
heartbeat_period=1,
idle_heartbeats_soft=1,
idle_heartbeats_hard=3,
)
Expand Down Expand Up @@ -302,7 +302,7 @@ def test_sends_final_status_message_on_shutdown(mocker, endpoint_uuid):

conf = Config(
executors=[mocker.Mock(endpoint_id=endpoint_uuid)],
heartbeat_period=0.01,
heartbeat_period=1,
idle_heartbeats_soft=1,
idle_heartbeats_hard=2,
)
Expand All @@ -327,7 +327,7 @@ def test_faithfully_handles_status_report_messages(mocker, endpoint_uuid, random

conf = Config(
executors=[mocker.Mock(endpoint_id=endpoint_uuid)],
heartbeat_period=0.01,
heartbeat_period=1,
)
ei = EndpointInterchange(
endpoint_id=endpoint_uuid,
Expand Down

0 comments on commit 9ad4812

Please sign in to comment.