From 6ed1b754ba84e51512a36fddec437b4e1fe676e2 Mon Sep 17 00:00:00 2001 From: "Michael J. Sullivan" Date: Thu, 6 Feb 2025 18:38:56 -0800 Subject: [PATCH] Try doing retries in test_ext_ai_indexing_02 The more general fix is that assert_query_result ought to do retries when not in a transaction, of course, but let's try to get this release out. --- tests/test_ext_ai.py | 38 ++++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/tests/test_ext_ai.py b/tests/test_ext_ai.py index 61e31fda175..caa6f5561f8 100644 --- a/tests/test_ext_ai.py +++ b/tests/test_ext_ai.py @@ -20,6 +20,8 @@ import pathlib import unittest +import edgedb + from edb.server.protocol import ai_ext from edb.testbase import http as tb @@ -255,20 +257,28 @@ async def test_ext_ai_indexing_02(self): # updating an object should make it disappear from results. # (the read is done in the same tx, so there is no possible # race where the worker picks it up before the read) - await self.assert_query_result( - """ - update Stuff filter .content like '%Earth' - set { content2 := ' are often grey' }; - """ + qry, - [ - { - 'content': 'Skies on Mars', - 'content2': ' are red', - 'distance': 0.4284523933505918, - }, - ], - variables=dict(qv=qv), - ) + async for tr in self.try_until_succeeds( + ignore=( + edgedb.TransactionConflictError, + edgedb.TransactionSerializationError, + ), + timeout=30.0, + ): + async with tr: + await self.assert_query_result( + """ + update Stuff filter .content like '%Earth' + set { content2 := ' are often grey' }; + """ + qry, + [ + { + 'content': 'Skies on Mars', + 'content2': ' are red', + 'distance': 0.4284523933505918, + }, + ], + variables=dict(qv=qv), + ) finally: await self.con.execute('''