@@ -128,7 +128,7 @@ async Task<AzureStorageOrchestrationService> EnsureTaskHubAsync(
128128 // Control queues
129129 Assert . IsNotNull ( service . AllControlQueues , "Control queue collection was not initialized." ) ;
130130 ControlQueue [ ] controlQueues = service . AllControlQueues . ToArray ( ) ;
131- Assert . AreEqual ( partitionCount , controlQueues . Length , "Expected to see the default four control queues created." ) ;
131+ Assert . AreEqual ( partitionCount , controlQueues . Length , $ "Expected to see the default { partitionCount } control queues created.") ;
132132 foreach ( ControlQueue queue in controlQueues )
133133 {
134134 Assert . IsTrue ( await queue . InnerQueue . ExistsAsync ( ) , $ "Queue { queue . Name } was not created.") ;
@@ -492,6 +492,16 @@ await TestHelpers.WaitFor(
492492 Assert . IsTrue ( queueMessages . All ( msg => msg . DequeueCount == 1 ) ) ;
493493 }
494494
495+ /// <summary>
496+ /// Confirm that if two workers try to complete the same work item, a SessionAbortedException is thrown which wraps the
497+ /// inner DurableTaskStorageException, which has the correct status code.
498+ /// We check two cases:
499+ /// 1. If this is the first work item for the orchestration , the DurableTaskStorageException that is wrapped has status "Conflict"
500+ /// which is due to trying to insert an orchestration history when one already exists.
501+ /// 2. If this is not the first work item, the DurableTaskStorageException that is wrapped has status "PreconditionFailed"
502+ /// which is due to trying to update the existing orchestration history with a stale etag.
503+ /// </summary>
504+ /// <returns></returns>
495505 [ TestMethod ]
496506 public async Task MultipleWorkersAttemptingToCompleteSameWorkItem ( )
497507 {
0 commit comments