Skip to content

Commit

Permalink
Always wait enough time for the database to be updated (#556)
Browse files Browse the repository at this point in the history
  • Loading branch information
Askaholic authored Mar 27, 2020
1 parent 144e685 commit 08a796c
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions tests/integration_tests/test_matchmaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

import pytest
from server.db.models import game_player_stats
from sqlalchemy import and_, select
from sqlalchemy import select
from tests.utils import fast_forward

from .conftest import connect_and_sign_in, read_until_command
from .conftest import connect_and_sign_in, read_until, read_until_command

pytestmark = pytest.mark.asyncio

Expand Down Expand Up @@ -111,7 +111,12 @@ async def test_game_matchmaking_start(lobby_server, database):
})

# Wait for db to be updated
await asyncio.sleep(1)
await read_until(
host, lambda cmd: cmd["command"] == "game_info" and cmd["launched_at"]
)
await read_until(
guest, lambda cmd: cmd["command"] == "game_info" and cmd["launched_at"]
)

async with database.acquire() as conn:
result = await conn.execute(select([
Expand Down

0 comments on commit 08a796c

Please sign in to comment.