From 8e4f34c6fbfcba77dbff9c8924070d6d48840bc3 Mon Sep 17 00:00:00 2001 From: "Michael J. Sullivan" Date: Fri, 10 May 2024 07:24:48 -0700 Subject: [PATCH] Work around the configure test flake (#7331) 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. --- tests/test_server_config.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/tests/test_server_config.py b/tests/test_server_config.py index d929df7d973..50a89875ae4 100644 --- a/tests/test_server_config.py +++ b/tests/test_server_config.py @@ -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"; @@ -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()