question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Spanner: ITs running in parallel even though parallelization is disabled

See original GitHub issue

I 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

  1. Setup the emulator as per instructions.
  2. Patch #4915.
  3. 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:closed
  • Created 3 years ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
skuruppucommented, May 26, 2020

Yup agree. I will reopen or create a separate issue if anything more comes up. Thanks again for your help @amanda-tarafa.

1reaction
skuruppucommented, May 21, 2020

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 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Disabling Parallelization For Systemd, For Cpu Overclocking
If the machine is unstable running multiple tasks in parallel, then it will not be able to run modern games, which also run...
Read more >
make: disable parallel execution of some targets
I have a compile job where linking is taking a lot of IO work. We have around a dozen of cores so we...
Read more >
Parallel steps | Workflows
A branch is a named set of steps that execute sequentially. Parallel branches can execute concurrently (with the steps in each branch executing...
Read more >
A complete guide to parallel testing
The blog walks us through the basics of parallel testing, its benefits, implementation, challenges, and the best-in-class parallel testing ...
Read more >
What Is Parallel Testing? A Getting Started Guide
Test parallelization is the practice of executing multiple software tests simultaneously. It's the opposite of serial testing, which requires ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found