Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

ADO.NET samples test are flaky

Open
#722 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
csharp
Domain
ci-cd, testing-qa

Research direction

Start by running the ADO.NET samples tests and inspect GettingStartedTests.cs around TestCreateTables at line 140 and the CreateTablesSample.cs calls at lines 24 and 41. Investigate the emulator connection failures reported by TestCreateTables and TestCreateConnection; done means the sample test suite runs reliably without these connection-reset failures.

Written by the indexing model from the issue text.

Description

priority: p2 samples type: bug
Running all tests in /home/runner/work/dotnet-spanner-entity-framework/dotnet-spanner-entity-framework/spanner-ado-net/spanner-ado-net-samples-tests/bin/Debug/net8.0/Google.Cloud.Spanner.DataProvider.Samples.Tests.dll
   NUnit3TestExecutor discovered 57 of 57 NUnit test cases using Current Discovery mode, Non-Explicit run
  Failed TestCreateTables [132 ms]
  Error Message:
   Google.Cloud.SpannerLib.SpannerException : Unavailable: Status(StatusCode="Unavailable", Detail="could not create instance projects/emulator-project/instances/sample-instance: rpc error: code = Unavailable desc = connection error: desc = "error reading server preface: read tcp 127.0.0.1:44614->127.0.0.1:32768: read: connection reset by peer"")
  Stack Trace:
     at Google.Cloud.SpannerLib.Grpc.GrpcLibSpanner.TranslateException[T](Func`1 f) in /_/spanner-ado-net/spanner-ado-net/SpannerLibGrpcImpl/GrpcLibSpanner.cs:line 154
   at Google.Cloud.SpannerLib.Grpc.GrpcLibSpanner.CreatePool(String connectionString) in /_/spanner-ado-net/spanner-ado-net/SpannerLibGrpcImpl/GrpcLibSpanner.cs:line 160
   at Google.Cloud.SpannerLib.Pool.Create(ISpannerLib spanner, String connectionString) in /_/spanner-ado-net/spanner-ado-net/SpannerLib/Pool.cs:line 37
   at Google.Cloud.Spanner.DataProvider.SpannerPool.GetOrCreate(String dsn) in /_/spanner-ado-net/spanner-ado-net/SpannerPool.cs:line 52
   at Google.Cloud.Spanner.DataProvider.SpannerConnection.Open() in /_/spanner-ado-net/spanner-ado-net/SpannerConnection.cs:line 371
   at System.Data.Common.DbConnection.OpenAsync(CancellationToken cancellationToken)
--- End of stack trace from previous location ---
   at Google.Cloud.Spanner.DataProvider.GettingStartedGuide.CreateTablesSample.CreateTables(String connectionString) in /home/runner/work/dotnet-spanner-entity-framework/dotnet-spanner-entity-framework/spanner-ado-net/spanner-ado-net-getting-started-guide/GettingStartedGuide/CreateTablesSample.cs:line 24
   at Google.Cloud.Spanner.DataProvider.GettingStartedGuide.CreateTablesSample.CreateTables(String connectionString) in /home/runner/work/dotnet-spanner-entity-framework/dotnet-spanner-entity-framework/spanner-ado-net/spanner-ado-net-getting-started-guide/GettingStartedGuide/CreateTablesSample.cs:line 41
   at Google.Cloud.Spanner.DataProvider.Samples.Tests.GettingStartedTests.TestCreateTables() in /home/runner/work/dotnet-spanner-entity-framework/dotnet-spanner-entity-framework/spanner-ado-net/spanner-ado-net-samples-tests/GettingStartedTests.cs:line 140
   at NUnit.Framework.Internal.TaskAwaitAdapter.GenericAdapter`1.GetResult()
   at NUnit.Framework.Internal.AsyncToSyncAdapter.Await[TResult](TestExecutionContext context, Func`1 invoke)
   at NUnit.Framework.Internal.AsyncToSyncAdapter.Await(TestExecutionContext context, Func`1 invoke)
   at NUnit.Framework.Internal.Commands.TestMethodCommand.RunTestMethod(TestExecutionContext context)
   at NUnit.Framework.Internal.Commands.TestMethodCommand.Execute(TestExecutionContext context)
   at NUnit.Framework.Internal.Commands.BeforeAndAfterTestCommand.<>c__DisplayClass1_0.<Execute>b__0()
   at NUnit.Framework.Internal.Commands.DelegatingTestCommand.RunTestMethodInThreadAbortSafeZone(TestExecutionContext context, Action action)
1)    at Google.Cloud.SpannerLib.Grpc.GrpcLibSpanner.TranslateException[T](Func`1 f) in /_/spanner-ado-net/spanner-ado-net/SpannerLibGrpcImpl/GrpcLibSpanner.cs:line 154
   at Google.Cloud.SpannerLib.Grpc.GrpcLibSpanner.CreatePool(String connectionString) in /_/spanner-ado-net/spanner-ado-net/SpannerLibGrpcImpl/GrpcLibSpanner.cs:line 160
   at Google.Cloud.SpannerLib.Pool.Create(ISpannerLib spanner, String connectionString) in /_/spanner-ado-net/spanner-ado-net/SpannerLib/Pool.cs:line 37
   at Google.Cloud.Spanner.DataProvider.SpannerPool.GetOrCreate(String dsn) in /_/spanner-ado-net/spanner-ado-net/SpannerPool.cs:line 52
   at Google.Cloud.Spanner.DataProvider.SpannerConnection.Open() in /_/spanner-ado-net/spanner-ado-net/SpannerConnection.cs:line 371
   at System.Data.Common.DbConnection.OpenAsync(CancellationToken cancellationToken)
--- End of stack trace from previous location ---
   at Google.Cloud.Spanner.DataProvider.GettingStartedGuide.CreateTablesSample.CreateTables(String connectionString) in /home/runner/work/dotnet-spanner-entity-framework/dotnet-spanner-entity-framework/spanner-ado-net/spanner-ado-net-getting-started-guide/GettingStartedGuide/CreateTablesSample.cs:line 24
   at Google.Cloud.Spanner.DataProvider.GettingStartedGuide.CreateTablesSample.CreateTables(String connectionString) in /home/runner/work/dotnet-spanner-entity-framework/dotnet-spanner-entity-framework/spanner-ado-net/spanner-ado-net-getting-started-guide/GettingStartedGuide/CreateTablesSample.cs:line 41
   at Google.Cloud.Spanner.DataProvider.Samples.Tests.GettingStartedTests.TestCreateTables() in /home/runner/work/dotnet-spanner-entity-framework/dotnet-spanner-entity-framework/spanner-ado-net/spanner-ado-net-samples-tests/GettingStartedTests.cs:line 140
   at NUnit.Framework.Internal.TaskAwaitAdapter.GenericAdapter`1.GetResult()
   at NUnit.Framework.Internal.AsyncToSyncAdapter.Await[TResult](TestExecutionContext context, Func`1 invoke)
   at NUnit.Framework.Internal.AsyncToSyncAdapter.Await(TestExecutionContext context, Func`1 invoke)
   at NUnit.Framework.Internal.Commands.TestMethodCommand.RunTestMethod(TestExecutionContext context)
   at NUnit.Framework.Internal.Commands.TestMethodCommand.Execute(TestExecutionContext context)
   at NUnit.Framework.Internal.Commands.BeforeAndAfterTestCommand.<>c__DisplayClass1_0.<Execute>b__0()
   at NUnit.Framework.Internal.Commands.DelegatingTestCommand.RunTestMethodInThreadAbortSafeZone(TestExecutionContext context, Action action)

  Failed TestCreateConnection [11 ms]
Dominant language
C#
Stars
34
Forks
13
Avg merge
5h 53m
Merged PRs (30d)
11

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from googleapis/dotnet-spanner-entity-framework

All issues in googleapis/dotnet-spanner-entity-framework

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.