Skip to content

Commit

Permalink
Remove accidental commmit
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelkaye committed Sep 27, 2023
1 parent 14efa47 commit 95a398f
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 27 deletions.
15 changes: 1 addition & 14 deletions trafficlight/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,14 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import asyncio
import json
import logging
import os
import uuid
from asyncio import Future
from datetime import datetime, timedelta
from typing import Any, Dict, Optional

from quart import Quart, current_app
from quart import Quart

import trafficlight.kiwi as kiwi
from trafficlight.homerunner import HomerunnerClient
Expand Down Expand Up @@ -118,17 +116,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
Expand Down
4 changes: 2 additions & 2 deletions trafficlight/internals/testcase.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def __init__(
server_names: List[str],
client_types: Dict[str, ClientType],
) -> None:
self.completed: Future[None]
self.completed: Optional[Future[bool]] = None
self.exceptions: List[str] = []
self.guid = hashlib.md5(
f"TestCase{test.name()}{server_type.name() if server_type else None}{server_names}{client_types}".encode(
Expand Down Expand Up @@ -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(False)

async def wait_for_completion(self) -> None:
self.completed = asyncio.get_running_loop().create_future()
Expand Down
3 changes: 2 additions & 1 deletion trafficlight/internals/testsuite.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import asyncio
import hashlib
from typing import List

Expand Down Expand Up @@ -52,3 +51,5 @@ def done(self) -> bool:
)
> 0
)
else:
return False
9 changes: 3 additions & 6 deletions trafficlight/tests/video/ec_basic_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion trafficlight/tests/video/load_test_call_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
7 changes: 4 additions & 3 deletions trafficlight/tests/video/three_user_spotlight.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit 95a398f

Please sign in to comment.