Skip to content

Commit

Permalink
Co-operatively cancel RPC Calls
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanwoctopusdeploy committed Dec 6, 2023
1 parent 9b19f36 commit a2e09aa
Show file tree
Hide file tree
Showing 30 changed files with 625 additions and 1,016 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,13 @@ await AssertionExtensions.Should(
throw exception;
},
RetryDuration, clientOperationMetricsBuilder, cancellationToken))
.ThrowAsync<TaskCanceledException>();
.ThrowAsync<HalibutClientException>();

// Assert
var metric = rpcCallObserver.RpcCallMetrics.Should().ContainSingle().Subject;

metric.Succeeded.Should().BeFalse();
metric.Exception?.GetType().Should().Be(typeof(TaskCanceledException));
metric.Exception.Should().BeEquivalentTo(exception);
metric.HasException.Should().BeTrue();
metric.WasCancelled.Should().BeTrue();

Expand Down Expand Up @@ -302,7 +302,6 @@ await sut.ExecuteWithRetries(
new RpcCall(RpcService, RpcCallName),
action,
Substitute.For<ILog>(),
false,
clientOperationMetricsBuilder,
cancellationToken);
}
Expand All @@ -320,7 +319,6 @@ private static async Task<Guid> ExecuteResult(
new RpcCall(RpcService, RpcCallName),
action,
Substitute.For<ILog>(),
abandonActionOnCancellation: false,
clientOperationMetricsBuilder,
cancellationToken);
}
Expand All @@ -342,7 +340,6 @@ await sut.ExecuteWithNoRetries(
return true;
},
Substitute.For<ILog>(),
abandonActionOnCancellation: false,
clientOperationMetricsBuilder,
cancellationToken);
}
Expand Down
Loading

0 comments on commit a2e09aa

Please sign in to comment.