diff --git a/trafficlight/__init__.py b/trafficlight/__init__.py index 89bf31f..27813dd 100644 --- a/trafficlight/__init__.py +++ b/trafficlight/__init__.py @@ -118,17 +118,6 @@ async def startup() -> None: if kiwi.kiwi_client: await kiwi.kiwi_client.start_run() - async def wait_for_done() -> None: - try: - if suite.done() for suite in get_testsuites(): - if suite.done() - logger.info("Everything done!") - await app.shutdown() - - app.add_background_task( - wait_for_done, - ) - @app.after_serving async def shutdown() -> None: adapter.stop_background_tasks = True diff --git a/trafficlight/internals/testcase.py b/trafficlight/internals/testcase.py index 0ac81a8..bb91e10 100644 --- a/trafficlight/internals/testcase.py +++ b/trafficlight/internals/testcase.py @@ -125,7 +125,7 @@ async def run( server.finished() if kiwi.kiwi_client: await kiwi.kiwi_client.report_status(self) - self.completed.set_result(True) + self.completed.set_result() async def wait_for_completion(self) -> None: self.completed = asyncio.get_running_loop().create_future() diff --git a/trafficlight/internals/testsuite.py b/trafficlight/internals/testsuite.py index 35428ea..bec638c 100644 --- a/trafficlight/internals/testsuite.py +++ b/trafficlight/internals/testsuite.py @@ -52,3 +52,5 @@ def done(self) -> bool: ) > 0 ) + else: + return False diff --git a/trafficlight/tests/video/ec_basic_example.py b/trafficlight/tests/video/ec_basic_example.py index 6375a3a..4640b34 100644 --- a/trafficlight/tests/video/ec_basic_example.py +++ b/trafficlight/tests/video/ec_basic_example.py @@ -14,13 +14,10 @@ def __init__(self) -> None: async def run(self, alice: ElementCallClient, bob: ElementCallClient) -> None: room_name = "tl_chat_" + str(datetime.now().timestamp()) - (alice_joined, bob_joined) = await asyncio.gather( - alice.create_or_join(room_name), bob.create_or_join(room_name) - ) + await alice.create(room_name) + alice_lobby = await alice.get_lobby_data() - # Check only one of alice or bob joined the room (the other created it) - # between two single-bit booleans, this is xor - print(str(alice_joined) + " or " + str(bob_joined)) + await bob.join_by_url(alice_lobby.invite_url) await asyncio.gather(alice.lobby_join(), bob.lobby_join()) await asyncio.sleep(5) diff --git a/trafficlight/tests/video/load_test_call_test.py b/trafficlight/tests/video/load_test_call_test.py index 898a575..56c9eee 100644 --- a/trafficlight/tests/video/load_test_call_test.py +++ b/trafficlight/tests/video/load_test_call_test.py @@ -25,7 +25,7 @@ async def run(self, alice: ElementCallClient, bob: ElementCallClient) -> None: room_name = "tl_chat_" + str(datetime.now().timestamp()) # Create room - await alice.create_or_join(room_name) + await alice.create(room_name) lobby_data = await alice.get_lobby_data() diff --git a/trafficlight/tests/video/three_user_spotlight.py b/trafficlight/tests/video/three_user_spotlight.py index 3705f47..428b869 100644 --- a/trafficlight/tests/video/three_user_spotlight.py +++ b/trafficlight/tests/video/three_user_spotlight.py @@ -19,9 +19,10 @@ async def run(self, alice: ElementCallClient, bob: ElementCallClient) -> None: room_name = "tl_chat_" + str(datetime.now().timestamp()) - await asyncio.gather( - alice.create_or_join(room_name), bob.create_or_join(room_name) - ) + await alice.create(room_name) + alice_lobby = await alice.get_lobby_data() + + await bob.join_by_url(alice_lobby.invite_url) # lobby screen await asyncio.gather(alice.lobby_join(), bob.lobby_join())