diff --git a/draw/tests.py b/draw/tests.py index e495697..9af7edc 100644 --- a/draw/tests.py +++ b/draw/tests.py @@ -1,6 +1,5 @@ # Copyright (C) 2023 by Animath # SPDX-License-Identifier: GPL-3.0-or-later -import asyncio from random import shuffle from asgiref.sync import sync_to_async @@ -712,15 +711,12 @@ class TestDraw(TestCase): {'tid': tid, 'type': 'export_visibility', 'visible': False}) # Cancel all steps and reset all - for i in range(1000): + for i in range(150): await communicator.send_json_to({'tid': tid, 'type': 'cancel'}) # Purge receive queue - while True: - try: - await communicator.receive_json_from() - except asyncio.TimeoutError: - break + while (await communicator.receive_json_from())['type'] != "abort": + pass if await Draw.objects.filter(tournament_id=tid).aexists(): print((await Draw.objects.filter(tournament_id=tid).aexists()))