@@ -715,6 +715,8 @@ def test_dask_cluster_connect(self, mocker, staging_instance: Staging, cluster_o
715715 "RSPY_DASK_STAGING_CLUSTER_NAME" : cluster_options ["cluster_name" ],
716716 },
717717 )
718+ # Mock the cluster mode
719+ mocker .patch ("rs_server_staging.processors.LOCAL_MODE" , new = False , autospec = False )
718720 # Mock the logger
719721 mock_logger = mocker .patch .object (staging_instance , "logger" )
720722 staging_instance .cluster = None
@@ -749,7 +751,9 @@ def test_dask_cluster_connect(self, mocker, staging_instance: Staging, cluster_o
749751 mock_client .assert_called_once_with (staging_instance .cluster )
750752
751753 # Ensure logging was called as expected
752- mock_logger .debug .assert_any_call (f"The list of clusters: { mock_list_clusters .return_value } " )
754+ mock_logger .debug .assert_any_call (
755+ f"Cluster list for gateway 'gateway-address': { mock_list_clusters .return_value } " ,
756+ )
753757 mock_logger .info .assert_any_call ("Number of running workers: 2" )
754758 mock_logger .debug .assert_any_call (
755759 f"Dask Client: { client } | Cluster dashboard: { mock_connect .return_value .dashboard_link } " ,
@@ -768,6 +772,8 @@ def test_dask_cluster_connect_failure_no_cluster_name(self, mocker, staging_inst
768772 "RSPY_DASK_STAGING_CLUSTER_NAME" : non_existent_cluster ,
769773 },
770774 )
775+ # Mock the cluster mode
776+ mocker .patch ("rs_server_staging.processors.LOCAL_MODE" , new = False , autospec = False )
771777 # Mock the logger
772778 mock_logger = mocker .patch .object (staging_instance , "logger" )
773779 staging_instance .cluster = None
@@ -791,7 +797,8 @@ def test_dask_cluster_connect_failure_no_cluster_name(self, mocker, staging_inst
791797 staging_instance .dask_cluster_connect ()
792798 # Ensure logging was called as expected
793799 mock_logger .exception .assert_any_call (
794- "Failed to find the specified dask cluster: " f"No dask cluster named '{ non_existent_cluster } ' was found." ,
800+ "Failed to find the specified dask cluster: "
801+ f"Dask cluster with 'cluster_name'={ non_existent_cluster !r} was not found." ,
795802 )
796803
797804 def test_dask_cluster_connect_failure_no_envs (self , mocker , staging_instance : Staging ):
0 commit comments