Skip to content

Commit

Permalink
Try doing retries in test_ext_ai_indexing_02
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
msullivan committed Feb 10, 2025
1 parent 7e132d9 commit 60b4442
Showing 1 changed file with 28 additions and 14 deletions.
42 changes: 28 additions & 14 deletions tests/test_ext_ai.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
import pathlib
import unittest

import edgedb

from edb.server.protocol import ai_ext
from edb.testbase import http as tb

Expand Down Expand Up @@ -255,20 +257,32 @@ 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:
try:
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),
)
except Exception as ex:
print("FUCK", ex)
raise

finally:
await self.con.execute('''
Expand Down

0 comments on commit 60b4442

Please sign in to comment.