Spanner: ITs running in parallel even though parallelization is disabled
See original GitHub issueI have some questions regarding how integration tests are run. I’m testing the C# client library against the Cloud Spanner emulator. When I ran the tests, I got a whole lot of errors like:
Error Message:
Google.Cloud.Spanner.Data.SpannerException : The operation was aborted.
---- Grpc.Core.RpcException : Status(StatusCode=Aborted, Detail="Transaction 16323 aborted due to active transaction 56. The emulator only supports one transaction at a time.")
Out of 167 tests, 106 of them failed. Then I ran some of these with a filter to run tests one file at a time or as specific tests. Then only 13 tests fail.
The only explanation I had for this was that tests were running in parallel and the emulator doesn’t support concurrent transactions.
Then I checked https://github.com/googleapis/google-cloud-dotnet/blob/12bdab84277957b5581388ab0e8d0de92cdd9413/apis/Google.Cloud.Spanner.Data/Google.Cloud.Spanner.Data.IntegrationTests/AssemblyInfo.cs#L16 and saw that we disable parallelization.
Now I don’t have an explanation for why the tests can’t be run.
Environment details
- OS: Linux
- .NET version: 3.1.102
- Package name and version: 3.0.0 with #4915
Steps to reproduce
- Setup the emulator as per instructions.
- Patch #4915.
- Run the following commands:
export GOOGLE_APPLICATION_CREDENTIALS=<creds>
export TEST_PROJECT=emulator-test-project
export SPANNER_EMULATOR_HOST=localhost:9010
cd /google-cloud-dotnet/apis/Google.Cloud.Spanner.Data/Google.Cloud.Spanner.Data.IntegrationTests
dotnet test
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (11 by maintainers)
Yup agree. I will reopen or create a separate issue if anything more comes up. Thanks again for your help @amanda-tarafa.
So most of the tests seem to pass, although I think something got stuck because I didn’t see it complete the last time I tried to run all the tests. But I’m no longer getting the transaction aborted exception from my first comment.
Now the tests that fail are expected to do so. I’m reporting them to the emulator team so that they can either fix them or if that’s infeasible, then we can conditionally skip them if the emulator is enabled.
I may ask you more questions next week as I run into more issues 😃