code: def on_before_run_once(self):
      res = super().on_before_run_once()
      if self.works and all(w.has_stopped for w in self.works):
          assert len(self.works) == 2
          return True
      return res
  
file_path: pytorch-lightning/tests/integrations_app/public/test_multi_node.py
imports: import os
  from unittest import mock
  import pytest
  from lightning.app.testing.helpers import _RunIf
  from lightning.app.testing.testing import LightningTestApp, application_testing
  from lightning_utilities.core.imports import package_available
  from integrations_app.public import _PATH_EXAMPLES
label_desc: Use image node_id 1 for calling the LightningTestMultiNodeApp obj's underlying member method code with example usage: obj.on_before_run_once() and returns: res, True