Skip to content

E2E: QA Replaced unreliable Thread.Sleep(500) with a counter/gate pattern that ensures both transactions are initialized before releasing them to compete for locks - #21165

Merged
andr317c merged 1 commit into
v16/devfrom
v16/QA/fix-flaky-integration-test
Dec 16, 2025
Merged

E2E: QA Replaced unreliable Thread.Sleep(500) with a counter/gate pattern that ensures both transactions are initialized before releasing them to compete for locks#21165
andr317c merged 1 commit into
v16/devfrom
v16/QA/fix-flaky-integration-test

Fix flaky test

49eaa07
Select commit
Loading
Failed to load commit list.
Azure Pipelines / Nightly E2E Test Umbraco CMS 14+ failed Dec 16, 2025 in 1h 1m 4s

Build #16.5.0--rc.preview.11+49eaa07 had test failures

Details

Tests

  • Failed: 3 (0.02%, 3 new, 0 recurring)
  • Passed: 12,233 (99.50%)
  • Other: 58 (0.47%)
  • Total: 12,294

Annotations

Check failure on line 179 in Build log

See this annotation in the file changed.

@azure-pipelines azure-pipelines / Nightly E2E Test Umbraco CMS 14+

Build log #L179

Error: The process 'C:\hostedtoolcache\windows\dotnet\dotnet.exe' failed with exit code 1

Check failure on line 184 in Build log

See this annotation in the file changed.

@azure-pipelines azure-pipelines / Nightly E2E Test Umbraco CMS 14+

Build log #L184

Dotnet command failed with non-zero exit code on the following projects : [
  'D:\\a\\1\\s\\tests\\Umbraco.Tests.Integration\\Umbraco.Tests.Integration.csproj'
]

Check failure on line 1 in Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services.ContentEventsTests.MoveContentBranchUnderMasked

See this annotation in the file changed.

@azure-pipelines azure-pipelines / Nightly E2E Test Umbraco CMS 14+

Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services.ContentEventsTests.MoveContentBranchUnderMasked

Umbraco.Cms.Core.Exceptions.BootFailedException : Could not check the upgrade state.
  ----> Microsoft.Data.SqlClient.SqlException : Execution Timeout Expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
Data:
  HelpLink.ProdName: Microsoft SQL Server
  HelpLink.ProdVer: 15.00.4382
  HelpLink.EvtSrc: MSSQLServer
  HelpLink.EvtID: -2
  HelpLink.BaseHelpUrl: https://go.microsoft.com/fwlink
  HelpLink.LinkId: 20476
  ----> System.ComponentModel.Win32Exception : The wait operation timed out.
Raw output
   at Umbraco.Cms.Infrastructure.Runtime.RuntimeState.GetUmbracoDatabaseState(IUmbracoDatabaseFactory databaseFactory) in /_/src/Umbraco.Infrastructure/Runtime/RuntimeState.cs:line 318
   at Umbraco.Cms.Infrastructure.Runtime.RuntimeState.DetermineRuntimeLevel() in /_/src/Umbraco.Infrastructure/Runtime/RuntimeState.cs:line 173
   at Umbraco.Cms.Tests.Integration.Testing.UmbracoIntegrationTestBase.SetupTestDatabase(TestUmbracoDatabaseFactoryProvider testUmbracoDatabaseFactoryProvider, IOptionsMonitor`1 connectionStrings, IUmbracoDatabaseFactory databaseFactory, ILoggerFactory loggerFactory, IRuntimeState runtimeState) in /_/tests/Umbraco.Tests.Integration/Testing/UmbracoIntegrationTestBase.cs:line 178
   at Umbraco.Cms.Tests.Integration.Testing.UmbracoIntegrationTestBase.UseTestDatabase(IServiceProvider serviceProvider) in /_/tests/Umbraco.Tests.Integration/Testing/UmbracoIntegrationTestBase.cs:line 130
   at Umbraco.Cms.Tests.Integration.Testing.UmbracoIntegrationTest.Setup() in /_/tests/Umbraco.Tests.Integration/Testing/UmbracoIntegrationTest.cs:line 80
   at InvokeStub_UmbracoIntegrationTest.Setup(Object, Object, IntPtr*)
   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
--SqlException
   at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, SqlCommand command, 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.SqlDataReader.TryConsumeMetaData()
   at Microsoft.Data.SqlClient.SqlDataReader.get_MetaData()
   at Microsoft.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)
   at Microsoft.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean isAsync, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
   at Microsoft.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry, String method)
   at Microsoft.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior)
   at Microsoft.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
   at StackExchange.Profiling.Data.ProfiledDbCommand.ExecuteDbDataReader(CommandBehavior behavior) in C:\projects\dotnet\src\MiniProfiler.Shared\Data\ProfiledDbCommand.cs:line 206
   at Umbraco.Cms.Infrastructure.Persistence.FaultHandling.RetryPolicy.ExecuteAction[TResult](Func`1 func) in /_/src/Umbraco.Infrastructure/Persistence/FaultHandling/RetryPolicy.cs:line 167
   at NPoco.Database.ExecuteReaderHelper(DbCommand cmd)
   at NPoco.Database.ExecuteDataReader(DbCommand cmd, Boolean sync)
   at NPoco.AsyncHelper.RunSync[T](Task`1 task)
   at NPoco.Database.QueryImp[T](T instance, Expression`1 listExpression, Func`2 idFunc, Sql Sql, PocoData pocoData)+MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at NPoco.Database.Fetch[T](String sql, Object[] args)
   at Umbraco.Cms.Persistence.SqlServer.Services.SqlServerSyntaxProvider.GetDefinedIndexes(IDatabase db) in /_/src/Umbraco.Cms.Persistence.SqlServer/Services/SqlServerSyntaxProvider.cs:line 249
   at Umbraco.Cms.Infrastructure.Migrations.Install.DatabaseSchemaCreator.ValidateSchema(IEnumerable`1 orderedTables) in /_/src/Umbraco.Infrastructure/Migrations/Install/DatabaseSchemaCreator.cs:line

Check failure on line 1 in Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services.ContentEventsTests.MoveContentBranchBackFromUnpublished

See this annotation in the file changed.

@azure-pipelines azure-pipelines / Nightly E2E Test Umbraco CMS 14+

Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services.ContentEventsTests.MoveContentBranchBackFromUnpublished

System.AggregateException : One or more errors occurred. (Execution Timeout Expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
Operation cancelled by user.)
  ----> Microsoft.Data.SqlClient.SqlException : Execution Timeout Expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
Operation cancelled by user.
Data:
  HelpLink.ProdName: Microsoft SQL Server
  HelpLink.ProdVer: 15.00.4382
  HelpLink.EvtSrc: MSSQLServer
  HelpLink.EvtID: -2
  HelpLink.BaseHelpUrl: https://go.microsoft.com/fwlink
  HelpLink.LinkId: 20476
  ----> System.ComponentModel.Win32Exception : The wait operation timed out.
Raw output
   at Umbraco.Cms.Infrastructure.Scoping.Scope.TryFinally(Action[] actions) in /_/src/Umbraco.Infrastructure/Scoping/Scope.cs:line 580
   at Umbraco.Cms.Infrastructure.Scoping.Scope.Dispose() in /_/src/Umbraco.Infrastructure/Scoping/Scope.cs:line 403
   at Umbraco.Cms.Core.Services.ContentService.Save(IContent content, Nullable`1 userId, ContentScheduleCollection contentSchedule) in D:\a\1\s\src\Umbraco.Core\Services\ContentService.cs:line 1149
   at Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services.ContentEventsTests.CreateBranch() in /_/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentEventsTests.cs:line 222
   at Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services.ContentEventsTests.MoveContentBranchBackFromUnpublished() in /_/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentEventsTests.cs:line 1821
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
--SqlException
   at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, SqlCommand command, 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.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   at Microsoft.Data.SqlClient.TdsParser.TdsExecuteTransactionManagerRequest(Byte[] buffer, TransactionManagerRequestType request, String transactionName, TransactionManagerIsolationLevel isoLevel, Int32 timeout, SqlInternalTransaction transaction, TdsParserStateObject stateObj, Boolean isDelegateControlRequest)
   at Microsoft.Data.SqlClient.SqlInternalConnectionTds.ExecuteTransaction2005(TransactionRequest transactionRequest, String transactionName, IsolationLevel iso, SqlInternalTransaction internalTransaction, Boolean isDelegateControlRequest)
   at Microsoft.Data.SqlClient.SqlInternalTransaction.Commit()
   at Microsoft.Data.SqlClient.SqlTransaction.Commit()
   at Umbraco.Cms.Infrastructure.Scoping.Scope.DisposeLastScope() in /_/src/Umbraco.Infrastructure/Scoping/Scope.cs:line 467
   at Umbraco.Cms.Infrastructure.Scoping.Scope.Dispose() in /_/src/Umbraco.Infrastructure/Scoping/Scope.cs:line 403
   at Umbraco.Cms.Core.Services.DocumentUrlService.CreateOrUpdateUrlSegmentsAsync(IEnumerable`1 documentsEnumerable) in D:\a\1\s\src\Umbraco.Core\Services\DocumentUrlService.cs:line 376
   at Umbraco.Cms.Core.Services.DocumentUrlService.CreateOrUpdateUrlSegmentsAsync(Guid key) in D:\a\1\s\src\Umbraco.Core\Services\DocumentUrlService.cs:line 324
   at Umbraco.Cms.Core.Cache.ContentCacheRefresher.HandleRouting(JsonPayload payload) in D:\a\1\s\src\Umbraco.Core\Cache\Refreshers\Implement\ContentCacheRefresher.cs:line 416
   at Umbraco.Cms.Core.Cache.ContentCacheRefresher.Refresh(JsonPayload[] payloads) in D:\a\1\s\src\Umbraco.Core\Cache\Refreshers\Implement\ContentCacheRefresher.cs:line 164
   at Umbraco.Cms.Infrastructure.Sync.ServerMessengerBase.Deliver[TPayload](ICacheRefresher refresher, TPayload[] payload) in /_/src/Umbraco.Infrastructure/Sync/ServerMessengerBase.cs:line 365
   at Umbraco.Cms.Core.Cache.DistributedCache.RefreshByPayload[TPayload](Guid refresherGuid, TPayload[] payload) in D:\a\1\s\src\Umbraco.Core\Cache\DistributedCache.cs:line 110
   at Umbraco.Extensions.DistributedCacheExtensions.RefreshContentCache(DistributedCache dc, IEnumerable`1 changes) in D:\a\1\s\src\Umbraco.Core\Cache\DistributedCacheExtensions.cs:line 149
   at Umbraco.Cms.Core.Cache.DistributedCacheNotificationHandlerBase`2.Handle(IEnumerable`1 notifications) in D:\a\1\s\src\U

Check failure on line 1 in Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services.ContentEventsTests.MoveContentBranchUnderPublished

See this annotation in the file changed.

@azure-pipelines azure-pipelines / Nightly E2E Test Umbraco CMS 14+

Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services.ContentEventsTests.MoveContentBranchUnderPublished

Umbraco.Cms.Core.Exceptions.BootFailedException : Could not check the upgrade state.
  ----> Microsoft.Data.SqlClient.SqlException : Execution Timeout Expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
Data:
  HelpLink.ProdName: Microsoft SQL Server
  HelpLink.EvtSrc: MSSQLServer
  HelpLink.EvtID: -2
  HelpLink.BaseHelpUrl: https://go.microsoft.com/fwlink
  HelpLink.LinkId: 20476
  ----> System.ComponentModel.Win32Exception : The wait operation timed out.
Raw output
   at Umbraco.Cms.Infrastructure.Runtime.RuntimeState.GetUmbracoDatabaseState(IUmbracoDatabaseFactory databaseFactory) in /_/src/Umbraco.Infrastructure/Runtime/RuntimeState.cs:line 318
   at Umbraco.Cms.Infrastructure.Runtime.RuntimeState.DetermineRuntimeLevel() in /_/src/Umbraco.Infrastructure/Runtime/RuntimeState.cs:line 173
   at Umbraco.Cms.Tests.Integration.Testing.UmbracoIntegrationTestBase.SetupTestDatabase(TestUmbracoDatabaseFactoryProvider testUmbracoDatabaseFactoryProvider, IOptionsMonitor`1 connectionStrings, IUmbracoDatabaseFactory databaseFactory, ILoggerFactory loggerFactory, IRuntimeState runtimeState) in /_/tests/Umbraco.Tests.Integration/Testing/UmbracoIntegrationTestBase.cs:line 178
   at Umbraco.Cms.Tests.Integration.Testing.UmbracoIntegrationTestBase.UseTestDatabase(IServiceProvider serviceProvider) in /_/tests/Umbraco.Tests.Integration/Testing/UmbracoIntegrationTestBase.cs:line 130
   at Umbraco.Cms.Tests.Integration.Testing.UmbracoIntegrationTest.Setup() in /_/tests/Umbraco.Tests.Integration/Testing/UmbracoIntegrationTest.cs:line 80
   at InvokeStub_UmbracoIntegrationTest.Setup(Object, Object, IntPtr*)
   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
--SqlException
   at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, SqlCommand command, Boolean callerHasConnectionLock, Boolean asyncClose)
   at Microsoft.Data.SqlClient.TdsParserStateObject.ThrowExceptionAndWarning(Boolean callerHasConnectionLock, Boolean asyncClose)
   at Microsoft.Data.SqlClient.TdsParserStateObject.ReadSniError(TdsParserStateObject stateObj, UInt32 error)
   at Microsoft.Data.SqlClient.TdsParserStateObject.ReadSniSyncOverAsync()
   at Microsoft.Data.SqlClient.TdsParserStateObject.TryPrepareBuffer()
   at Microsoft.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at Microsoft.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
   at Microsoft.Data.SqlClient.SqlDataReader.get_MetaData()
   at Microsoft.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)
   at Microsoft.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean isAsync, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
   at Microsoft.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry, String method)
   at Microsoft.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior)
   at Microsoft.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
   at StackExchange.Profiling.Data.ProfiledDbCommand.ExecuteDbDataReader(CommandBehavior behavior) in C:\projects\dotnet\src\MiniProfiler.Shared\Data\ProfiledDbCommand.cs:line 206
   at Umbraco.Cms.Infrastructure.Persistence.FaultHandling.RetryPolicy.ExecuteAction[TResult](Func`1 func) in /_/src/Umbraco.Infrastructure/Persistence/FaultHandling/RetryPolicy.cs:line 167
   at NPoco.Database.ExecuteReaderHelper(DbCommand cmd)
   at NPoco.Database.ExecuteDataReader(DbCommand cmd, Boolean sync)
   at NPoco.AsyncHelper.RunSync[T](Task`1 task)
   at NPoco.Database.QueryImp[T](T instance, Expression`1 listExpression, Func`2 idFunc, Sql Sql, PocoData pocoData)+MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at NPoco.Database.Fetch[T](String sql, Object[] args)
   a