Skip to content

Commit

Permalink
Co-operatively cancel RPC Calls (#730)
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanwoctopusdeploy authored Dec 11, 2023
1 parent 8fa00ba commit dfa3c4b
Show file tree
Hide file tree
Showing 30 changed files with 677 additions and 1,011 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 @@ -301,8 +301,8 @@ private static async Task ExecuteWithRetries(
await sut.ExecuteWithRetries(
new RpcCall(RpcService, RpcCallName),
action,
null,
Substitute.For<ILog>(),
false,
clientOperationMetricsBuilder,
cancellationToken);
}
Expand All @@ -320,7 +320,6 @@ private static async Task<Guid> ExecuteResult(
new RpcCall(RpcService, RpcCallName),
action,
Substitute.For<ILog>(),
abandonActionOnCancellation: false,
clientOperationMetricsBuilder,
cancellationToken);
}
Expand All @@ -342,7 +341,6 @@ await sut.ExecuteWithNoRetries(
return true;
},
Substitute.For<ILog>(),
abandonActionOnCancellation: false,
clientOperationMetricsBuilder,
cancellationToken);
}
Expand Down
Loading

0 comments on commit dfa3c4b

Please sign in to comment.