Skip to content
This repository was archived by the owner on Mar 31, 2026. It is now read-only.

Commit f3ddfe2

Browse files
committed
Fix test_transaction_batch_update_wo_statements flake due to Aborted by using run_in_transaction
1 parent fa73c8e commit f3ddfe2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/system/test_session_api.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1360,11 +1360,12 @@ def test_transaction_batch_update_wo_statements(sessions_database, sessions_to_d
13601360
session.create()
13611361
sessions_to_delete.append(session)
13621362

1363-
with session.transaction() as transaction:
1364-
transaction.begin()
1363+
def unit_of_work(transaction):
13651364
with pytest.raises(exceptions.InvalidArgument):
13661365
transaction.batch_update([])
13671366

1367+
session.run_in_transaction(unit_of_work)
1368+
13681369

13691370
@pytest.mark.skipif(
13701371
not ot_helpers.HAS_OPENTELEMETRY_INSTALLED,

0 commit comments

Comments
 (0)