syncstorage-rs icon indicating copy to clipboard operation
syncstorage-rs copied to clipboard

Db unit tests fail against Spanner emulator

Open data-sync-user opened this issue 2 months ago • 0 comments

We don’t explicitly roll back test transactions against spanner (we rely on diesel test_transactions for this, of which there’s no equivalent on our spanner impl). This seems to trigger a “bug” in the spanner emulator where it doesn’t clean up the previous transaction, then later errors out that the emulator only supports handling of one transaction at a time.

We can fix this by manually rolling back the transactions ourselves in the test, we would need something along the lines of the db_pool.transaction_http/http methods that wraps around every db unit test, which would begin a transaction and roll it all back at the end.

This would also let us cleanup some of the unfortunate implicit transaction handling in the spanner implementation.

┆Issue is synchronized with this Jira Task

data-sync-user avatar Oct 18 '25 00:10 data-sync-user