Skip to content

Commit

Permalink
Retry DROP DATABASE for tests
Browse files Browse the repository at this point in the history
This partially reverts commit 3285fcb.
  • Loading branch information
fantix committed Sep 19, 2024
1 parent 2fba1cb commit 7660db8
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion edb/testbase/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,18 @@ def _extract_background_errors(metrics: str) -> str | None:


async def drop_db(conn, dbname):
await conn.execute(f'DROP DATABASE {dbname}')
# net_worker (#7742) may issue a query while DROP DATABASE happens.
# This is a WIP bug that should be solved when adopting notification-
# driven net_worker, but hack around it with a retry loop for now.
# Without this, tests would flake a lot.
async for tr in TestCase.try_until_succeeds(
ignore=(edgedb.ExecutionError, edgedb.ClientConnectionError),
timeout=30
):
async with tr:
await conn.execute(
f'DROP DATABASE {dbname};'
)


class ClusterTestCase(BaseHTTPTestCase):
Expand Down

0 comments on commit 7660db8

Please sign in to comment.