Skip to content

Commit

Permalink
LIU-396: Code review updates
Browse files Browse the repository at this point in the history
  • Loading branch information
myxie committed Oct 22, 2024
1 parent 3418dda commit c727883
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
21 changes: 15 additions & 6 deletions daliuge-engine/test/deploy/test_graph_to_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
from dlg.dropmake.web.translator_utils import (unroll_and_partition_with_params,
prepare_lgt)
from dlg.manager.composite_manager import DataIslandManager
from test.dlg_engine_testutils import NMTestsMixIn, DROPManagerUtils
from dlg.ddap_protocol import DROPStates
from dlg.testutils import ManagerStarter
import daliuge_tests.engine.graphs as test_graphs
from test.dlg_engine_testutils import NMTestsMixIn, DROPManagerUtils

def create_full_hostname(server_info, event_port, rpc_port):

Expand Down Expand Up @@ -98,10 +98,19 @@ def test_input_in_remote_nm(self):
self.dim.addGraphSpec("TestSession", pg_spec)
self.dim.deploySession("TestSession", completedDrops=roots)

from dlg.ddap_protocol import DROPStates
time.sleep(30)
for dropstatus in self.dim.getGraphStatus("TestSession").values():
self.assertEqual(DROPStates.COMPLETED, dropstatus['status'])
max_wait_time = 30 # seconds
poll_interval = 1 # second
start_time = time.time()
all_completed = False
while time.time() - start_time < max_wait_time:
all_completed = all(
status['status'] == DROPStates.COMPLETED
for status in self.dim.getGraphStatus("TestSession").values()
)
if all_completed:
break
time.sleep(poll_interval)
self.assertTrue(all_completed)


def tearDown(self):
Expand Down
2 changes: 1 addition & 1 deletion daliuge-engine/test/dlg_engine_testutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def nm_conninfo(n, return_tuple=False):
if return_tuple:
return "localhost", 5553 + n, 6666 + n
else:
return Node(f"localhost:{8000}:{5553+n}:{6666+n}")
return Node(f"localhost:8000:{5553 + n}:{6666 + n}")


@staticmethod
Expand Down

0 comments on commit c727883

Please sign in to comment.