File tree Expand file tree Collapse file tree 4 files changed +10
-8
lines changed
Azure.Messaging.ServiceBus/tests/Processor
Microsoft.Azure.WebJobs.Extensions.ServiceBus/tests Expand file tree Collapse file tree 4 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -906,6 +906,8 @@ async Task ProcessMessage(ProcessMessageEventArgs args)
906906 }
907907
908908 var initialLockedUntil = args . Message . LockedUntil ;
909+ // introduce a small delay so that the service honors the renewal request
910+ await Task . Delay ( 500 ) ;
909911 await args . RenewMessageLockAsync ( args . Message ) ;
910912 Assert . Greater ( args . Message . LockedUntil , initialLockedUntil ) ;
911913 }
Original file line number Diff line number Diff line change @@ -693,6 +693,8 @@ async Task ProcessMessage(ProcessSessionMessageEventArgs args)
693693 }
694694
695695 var initialLockedUntil = args . SessionLockedUntil ;
696+ // introduce a small delay so that the service honors the renewal request
697+ await Task . Delay ( 500 ) ;
696698 await args . RenewSessionLockAsync ( ) ;
697699 Assert . Greater ( args . SessionLockedUntil , initialLockedUntil ) ;
698700 }
Original file line number Diff line number Diff line change @@ -1070,7 +1070,6 @@ public static void Run(
10701070 DateTimeOffset [ ] expiresAtArray ,
10711071 DateTime [ ] enqueuedTimeUtcArray ,
10721072 DateTimeOffset [ ] enqueuedTimeArray ,
1073- DateTimeOffset [ ] lockedUntilArray ,
10741073 string [ ] contentTypeArray ,
10751074 string [ ] replyToArray ,
10761075 string [ ] toArray ,
@@ -1097,8 +1096,7 @@ public static void Run(
10971096 Assert . Greater ( expiresAtUtcArray [ i ] , DateTime . UtcNow ) ;
10981097 Assert . AreEqual ( expiresAtArray [ i ] . DateTime , expiresAtUtcArray [ i ] ) ;
10991098 Assert . Less ( enqueuedTimeUtcArray [ i ] , DateTime . UtcNow ) ;
1100- Assert . AreEqual ( enqueuedTimeArray [ i ] . DateTime , enqueuedTimeArray [ i ] ) ;
1101- Assert . Greater ( lockedUntilArray [ i ] , DateTimeOffset . UtcNow ) ;
1099+ Assert . AreEqual ( enqueuedTimeArray [ i ] . DateTime , enqueuedTimeUtcArray [ i ] ) ;
11021100 }
11031101 string [ ] messages = array . Select ( x => x . Body . ToString ( ) ) . ToArray ( ) ;
11041102 ServiceBusMultipleTestJobsBase . ProcessMessages ( messages ) ;
Original file line number Diff line number Diff line change @@ -696,7 +696,7 @@ public class DrainModeTestJobQueueBatch
696696 public static async Task QueueWithSessionsBatch (
697697 [ ServiceBusTrigger ( FirstQueueNameKey , IsSessionsEnabled = true ) ]
698698 ServiceBusReceivedMessage [ ] array ,
699- ServiceBusSessionMessageActions messageActions ,
699+ ServiceBusSessionMessageActions sessionActions ,
700700 CancellationToken cancellationToken ,
701701 ILogger logger )
702702 {
@@ -710,11 +710,11 @@ public static async Task QueueWithSessionsBatch(
710710 foreach ( ServiceBusReceivedMessage msg in array )
711711 {
712712 // validate that manual lock renewal works
713- var initialLockedUntil = messageActions . SessionLockedUntil ;
714- await messageActions . RenewSessionLockAsync ( ) ;
715- Assert . Greater ( messageActions . SessionLockedUntil , initialLockedUntil ) ;
713+ var initialLockedUntil = sessionActions . SessionLockedUntil ;
714+ await sessionActions . RenewSessionLockAsync ( ) ;
715+ Assert . Greater ( sessionActions . SessionLockedUntil , initialLockedUntil ) ;
716716
717- await messageActions . CompleteMessageAsync ( msg ) ;
717+ await sessionActions . CompleteMessageAsync ( msg ) ;
718718 }
719719
720720 _drainValidationPostDelay . Set ( ) ;
You can’t perform that action at this time.
0 commit comments