Skip to content

Commit

Permalink
Work around the configure test flake (#7331)
Browse files Browse the repository at this point in the history
Put a retry loop around it; this will still properly test the main
functionality being tested by that part of the case.

I've filed #7330 to track the issue, which got exposed by some new
testing added in #7287.
  • Loading branch information
msullivan committed May 10, 2024
1 parent 0436c50 commit 8e4f34c
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions tests/test_server_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -1372,10 +1372,16 @@ async def test_server_proto_configure_error(self):
configure current database set force_database_error :=
{qlquote.quote_literal(json.dumps(err))};
''')
with self.assertRaisesRegex(edgedb.SchemaError, 'danger'):
async for tx in con1.retrying_transaction():
async with tx:
await tx.query('select schema::Object')
# FIXME (#7330): This part of the test was flaking
# sometimes, even though the change *should* be visible
# immediately on the current connection. Suppress it with
# a retry loop for now.
async for tr in self.try_until_succeeds(ignore=AssertionError):
async with tr:
with self.assertRaisesRegex(edgedb.SchemaError, 'danger'):
async for tx in con1.retrying_transaction():
async with tx:
await tx.query('select schema::Object')

await con2.execute(f'''
configure session set force_database_error := "false";
Expand All @@ -1399,6 +1405,7 @@ async def test_server_proto_configure_error(self):
):
async with tr:
await con2.execute('select 1')
await con1.execute('select 1')
finally:
await con2.aclose()

Expand Down

0 comments on commit 8e4f34c

Please sign in to comment.