SneaksAndData / arcane-framework

Akka.NET-based framework for data streaming services using the Arcane Kubernetes Operator
Apache License 2.0
4 stars 2 forks source link

[BUG] SQL server tests are unstable #66

Open s-vitaliy opened 3 months ago

s-vitaliy commented 3 months ago

It seems we have an issue with SQL server container. For some reason the SQL sever tests can fail, see: https://github.com/SneaksAndData/arcane-framework/actions/runs/9763670748/job/26950106919

[xUnit.net 00:00:09.65]     Arcane.Framework.Tests.Sources.SqlServerSourceTests.Test [FAIL]
[xUnit.net 00:00:09.66]     Arcane.Framework.Tests.Sources.SqlServerSourceTests.GetParquetSchema [FAIL]
[INFO][07/02/2024 15:19:40.022Z][Thread 0005][LogSource (akka://AkkaFixture)] No data returned by latest call, next check in 1 seconds

Error: System.AggregateException : One or more errors occurred. (A severe error occurred on the current command.  The results, if any, should be discarded.) (The following constructor parameters did not have matching fixture data: ServiceFixture serviceFixture)
---- Microsoft.Data.SqlClient.SqlException : A severe error occurred on the current command.  The results, if any, should be discarded.
---- The following constructor parameters did not have matching fixture data: ServiceFixture serviceFixture

  Failed Arcane.Framework.Tests.Sources.SqlServerSourceTests.Test [1 ms]
  Error Message:
   System.AggregateException : One or more errors occurred. (A severe error occurred on the current command.  The results, if any, should be discarded.) (The following constructor parameters did not have matching fixture data: ServiceFixture serviceFixture)
---- Microsoft.Data.SqlClient.SqlException : A severe error occurred on the current command.  The results, if any, should be discarded.
---- The following constructor parameters did not have matching fixture data: ServiceFixture serviceFixture
  Stack Trace:

----- Inner Stack Trace #1 (Microsoft.Data.SqlClient.SqlException) -----
   at Microsoft.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at Microsoft.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at Microsoft.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at Microsoft.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean isAsync, Int32 timeout, Boolean asyncWrite)
   at Microsoft.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry, String methodName)
   at Microsoft.Data.SqlClient.SqlCommand.ExecuteNonQuery()
   at Arcane.Framework.Tests.Fixtures.ServiceFixture..ctor() in /home/runner/work/arcane-framework/arcane-framework/test/Fixtures/ServiceFixture.cs:line 35
----- Inner Stack Trace #2 (Xunit.Sdk.TestClassException) -----

Error: System.AggregateException : One or more errors occurred. (A severe error occurred on the current command.  The results, if any, should be discarded.) (The following constructor parameters did not have matching fixture data: ServiceFixture serviceFixture)
---- Microsoft.Data.SqlClient.SqlException : A severe error occurred on the current command.  The results, if any, should be discarded.
---- The following constructor parameters did not have matching fixture data: ServiceFixture serviceFixture

  Failed Arcane.Framework.Tests.Sources.SqlServerSourceTests.GetParquetSchema [1 ms]
  Error Message:
   System.AggregateException : One or more errors occurred. (A severe error occurred on the current command.  The results, if any, should be discarded.) (The following constructor parameters did not have matching fixture data: ServiceFixture serviceFixture)
---- Microsoft.Data.SqlClient.SqlException : A severe error occurred on the current command.  The results, if any, should be discarded.
---- The following constructor parameters did not have matching fixture data: ServiceFixture serviceFixture
  Stack Trace:

----- Inner Stack Trace #1 (Microsoft.Data.SqlClient.SqlException) -----
   at Microsoft.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at Microsoft.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at Microsoft.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at Microsoft.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean isAsync, Int32 timeout, Boolean asyncWrite)
   at Microsoft.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry, String methodName)
   at Microsoft.Data.SqlClient.SqlCommand.ExecuteNonQuery()
   at Arcane.Framework.Tests.Fixtures.ServiceFixture..ctor() in /home/runner/work/arcane-framework/arcane-framework/test/Fixtures/ServiceFixture.cs:line 35
----- Inner Stack Trace #2 (Xunit.Sdk.TestClassException) -----

We should upgrade SQL server version in the test container and/or add some retries in the ServiceFixture.