Browse Source

Make testHedgingWhenAllAttemptsResultInNonFatalCodes more reliable (#1780)

Motivation:

`testHedgingWhenAllAttemptsResultInNonFatalCodes` fails occasionally.
The reason for this is that when the event stating that next scheduled
attempt is cancelled is consumed it cancels the next scheduled attempt
again. However, this is incorrect, another hedged result may have
re-scheduled an attempt which is subsequently cancelled by accident.

Modifications:

Don't double cancel the next scheduled attempt.

result:

The test passes more reliably
George Barnett 2 years ago
parent
commit
2034543431

+ 1 - 2
Sources/GRPCCore/Call/Client/Internal/ClientRPCExecutor+HedgingExecutor.swift

@@ -230,8 +230,7 @@ extension ClientRPCExecutor.HedgingExecutor {
             }
 
           case .cancelled:
-            // Cancelling also resets the state.
-            nextScheduledAttempt.cancel()
+            ()
           }
 
         case .attemptCompleted(let outcome):