diff --git a/src/lightning_app/components/multi_node/base.py b/src/lightning_app/components/multi_node/base.py index 5662442b7375a..ac99abecff028 100644 --- a/src/lightning_app/components/multi_node/base.py +++ b/src/lightning_app/components/multi_node/base.py @@ -56,12 +56,12 @@ def run( """ super().__init__() if num_nodes > 1 and not is_running_in_cloud(): - num_nodes = 1 warnings.warn( f"You set {type(self).__name__}(num_nodes={num_nodes}, ...)` but this app is running locally." " We assume you are debugging and will ignore the `num_nodes` argument." " To run on multiple nodes in the cloud, launch your app with `--cloud`." ) + num_nodes = 1 self.ws = structures.List( *[ work_cls( diff --git a/tests/tests_app/components/multi_node/test_base.py b/tests/tests_app/components/multi_node/test_base.py index 8582047a2ff20..8fd4f28e679a0 100644 --- a/tests/tests_app/components/multi_node/test_base.py +++ b/tests/tests_app/components/multi_node/test_base.py @@ -13,7 +13,7 @@ class Work(LightningWork): def run(self): pass - with pytest.warns(UserWarning, match=escape("You set MultiNode(num_nodes=1, ...)` but ")): + with pytest.warns(UserWarning, match=escape("You set MultiNode(num_nodes=2, ...)` but ")): MultiNode(Work, num_nodes=2, cloud_compute=CloudCompute("gpu")) with no_warning_call(UserWarning, match=escape("You set MultiNode(num_nodes=1, ...)` but ")):