Skip to content

Conversation

olavloite
Copy link
Contributor

@olavloite olavloite commented Aug 13, 2025

The Emulator returns an empty pre-commit token when a commit is attempted
without a pre-commit token. This is different from not returning any
pre-commit token at all. The check for 'did the Commit return a pre-commit
token?' did not take this into account, which caused commits on the
Emulator that needed to be retried, not to be retried. This again caused
multiple test errors when running on the Emulator, as this would keep a
transaction present on the test database on the Emulator, and the Emulator
only supports one transaction at a time. These test failures went unnoticed,
because the test configuration for the Emulator had pinned the Emulator
version to 1.5.37, which did not support multiplexed sessions. This again
caused the tests to fall back to using regular sessions.

This change fixes the check for whether a pre-commit token was returned by
a Commit. It also unpins the Emulator version for the system tests using
default settings. This ensures that the tests actually use multiplexed
sessions.

See this failed test run from before making these changes (the only change for this test run was to use the latest emulator version, which triggered multiplexed sessions to be used): https://github.com/googleapis/python-spanner/actions/runs/16940453081/job/48007847941?pr=1402

@olavloite olavloite requested review from a team as code owners August 13, 2025 14:35
@product-auto-label product-auto-label bot added the size: xs Pull request size is extra small. label Aug 13, 2025
@product-auto-label product-auto-label bot added the api: spanner Issues related to the googleapis/python-spanner API. label Aug 13, 2025
@olavloite olavloite force-pushed the precommit-token-check branch from 253ba9c to 04ec723 Compare August 13, 2025 14:56
@olavloite olavloite marked this pull request as draft August 13, 2025 15:44
@olavloite olavloite force-pushed the precommit-token-check branch from 04ec723 to 550e2e1 Compare August 14, 2025 06:29
@product-auto-label product-auto-label bot added size: s Pull request size is small. and removed size: xs Pull request size is extra small. labels Aug 14, 2025
@olavloite olavloite force-pushed the precommit-token-check branch 3 times, most recently from 41b4e54 to 3d205c6 Compare August 14, 2025 12:15
The Emulator returns an empty pre-commit token when a commit is attempted
without a pre-commit token. This is different from not returning any
pre-commit token at all. The check for 'did the Commit return a pre-commit
token?' did not take this into account, which caused commits on the
Emulator that needed to be retried, not to be retried. This again caused
multiple test errors when running on the Emulator, as this would keep a
transaction present on the test database on the Emulator, and the Emulator
only supports one transaction at a time. These test failures went unnoticed,
because the test configuration for the Emulator had pinned the Emulator
version to 1.5.37, which did not support multiplexed sessions. This again
caused the tests to fall back to using regular sessions.

This change fixes the check for whether a pre-commit token was returned by
a Commit. It also unpins the Emulator version for the system tests using
default settings. This ensures that the tests actually use multiplexed
sessions.
@olavloite olavloite force-pushed the precommit-token-check branch from 3d205c6 to c9894e1 Compare August 14, 2025 12:30
@olavloite olavloite marked this pull request as ready for review August 14, 2025 12:44
@olavloite olavloite requested a review from rahul2393 August 14, 2025 12:44
@rahul2393 rahul2393 merged commit d35e7f4 into main Aug 14, 2025
23 checks passed
@rahul2393 rahul2393 deleted the precommit-token-check branch August 14, 2025 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: spanner Issues related to the googleapis/python-spanner API. size: s Pull request size is small.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants