From 06e72ec000885f18dc79f34f53200c6eda9fb841 Mon Sep 17 00:00:00 2001 From: Yuchen Zhang <134643420+yczhang-nv@users.noreply.github.com> Date: Wed, 6 Nov 2024 11:47:01 -0800 Subject: [PATCH] fix tests --- tests/morpheus/pipeline/test_error_pipe.py | 20 -------------------- tests/morpheus/stages/test_monitor_stage.py | 10 +++++----- tests/test_monitor_stage_pipe.py | 3 +-- 3 files changed, 6 insertions(+), 27 deletions(-) diff --git a/tests/morpheus/pipeline/test_error_pipe.py b/tests/morpheus/pipeline/test_error_pipe.py index cb264f2231..478f1f7b18 100755 --- a/tests/morpheus/pipeline/test_error_pipe.py +++ b/tests/morpheus/pipeline/test_error_pipe.py @@ -42,23 +42,3 @@ def test_stage_raises_exception(config: Config, filter_probs_df: DataFrameType, # Ensure that the raised exception was from our stage and not from something else assert error_raiser_stage.error_raised assert len(sink_stage.get_messages()) == 0 - - -@pytest.mark.gpu_and_cpu_mode -@pytest.mark.parametrize("delayed_start", [False, True]) -def test_monitor_not_impl(config: Config, delayed_start: bool): - - class UnsupportedType: - pass - - pipe = LinearPipeline(config) - pipe.set_source(InMemSourceXStage(config, [UnsupportedType()])) - monitor_stage = pipe.add_stage(MonitorStage(config, log_level=logging.WARNING, delayed_start=delayed_start)) - sink_stage = pipe.add_stage(InMemorySinkStage(config)) - - assert monitor_stage._mc.is_enabled() - - with pytest.raises(NotImplementedError): - pipe.run() - - assert len(sink_stage.get_messages()) == 0 diff --git a/tests/morpheus/stages/test_monitor_stage.py b/tests/morpheus/stages/test_monitor_stage.py index 58a291f73c..d810f64aa7 100755 --- a/tests/morpheus/stages/test_monitor_stage.py +++ b/tests/morpheus/stages/test_monitor_stage.py @@ -59,7 +59,7 @@ def two_x(x): assert stage._mc._determine_count_fn is two_x -@pytest.mark.use_python +@pytest.mark.cpu_mode @mock.patch('morpheus.controllers.monitor_controller.MorpheusTqdm') def test_start_async(mock_morph_tqdm: mock.MagicMock, config: Config): mock_morph_tqdm.return_value = mock_morph_tqdm @@ -73,7 +73,7 @@ def test_start_async(mock_morph_tqdm: mock.MagicMock, config: Config): assert stage._mc._progress is mock_morph_tqdm -@pytest.mark.use_python +@pytest.mark.cpu_mode @mock.patch('morpheus.controllers.monitor_controller.MorpheusTqdm') async def test_join(mock_morph_tqdm: mock.MagicMock, config: Config): mock_morph_tqdm.return_value = mock_morph_tqdm @@ -90,7 +90,7 @@ async def test_join(mock_morph_tqdm: mock.MagicMock, config: Config): mock_morph_tqdm.close.assert_called_once() -@pytest.mark.use_python +@pytest.mark.cpu_mode @mock.patch('morpheus.controllers.monitor_controller.MorpheusTqdm') def test_refresh(mock_morph_tqdm: mock.MagicMock, config: Config): mock_morph_tqdm.return_value = mock_morph_tqdm @@ -154,7 +154,7 @@ def test_progress_sink(mock_morph_tqdm: mock.MagicMock, config: Config): mock_morph_tqdm.update.assert_called_once_with(n=12) -@pytest.mark.use_python +@pytest.mark.cpu_mode @pytest.mark.usefixtures("reset_loglevel") @pytest.mark.parametrize('log_level', [logging.CRITICAL, logging.ERROR, logging.WARNING, logging.INFO, logging.DEBUG]) @mock.patch('morpheus.stages.general.monitor_stage.MonitorController.sink_on_completed', autospec=True) @@ -183,7 +183,7 @@ def test_log_level(mock_progress_sink: mock.MagicMock, assert mock_sink_on_completed.call_count == expected_call_count -@pytest.mark.gpu_and_cpu_mode +@pytest.mark.cpu_mode def test_thread(config: Config, morpheus_log_level: int): """ Test ensures the monitor stage executes on the same thread as the parent stage diff --git a/tests/test_monitor_stage_pipe.py b/tests/test_monitor_stage_pipe.py index 86e09dd650..c35243864e 100755 --- a/tests/test_monitor_stage_pipe.py +++ b/tests/test_monitor_stage_pipe.py @@ -44,8 +44,7 @@ def sample_message_meta_generator(df_rows: int, df_cols: int, count: int) -> Gen yield meta -@pytest.mark.use_cudf -@pytest.mark.usefixtures("use_cpp") +@pytest.mark.gpu_mode def test_cpp_monitor_stage_pipe(config): config.num_threads = 1