Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add simple message to polling timeout error #602

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion source/Halibut.Tests/ExceptionContractFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public async Task WhenThePollingRequestQueueTimeoutIsReached_AHalibutClientExcep
var client = clientOnly.CreateClientWithoutService<IEchoService, IAsyncClientEchoServiceWithOptions>();

(await AssertException.Throws<HalibutClientException>(async () => await client.SayHelloAsync("Hello", new(CancellationToken))))
.And.Message.Should().Contain("A request was sent to a polling endpoint, but the polling endpoint did not collect the request within the allowed time (00:00:05), so the request timed out.");
.And.Message.Should().Contain("A request was sent to a polling endpoint, but the polling endpoint did not collect the request within the allowed time (00:00:05), so the request timed out. Please check the tentacle logs to investigate this timeout.");
}


Expand Down
2 changes: 1 addition & 1 deletion source/Halibut.Tests/PollingServiceTimeoutsFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public async Task WhenThePollingRequestQueueTimeoutIsReached_TheRequestShouldTim
var stopwatch = Stopwatch.StartNew();
var exception = (await AssertException.Throws<HalibutClientException>(async () => await client.SayHelloAsync("Hello", new(CancellationToken)))).And;

exception.Message.Should().Contain("A request was sent to a polling endpoint, but the polling endpoint did not collect the request within the allowed time (00:00:05), so the request timed out.");
exception.Message.Should().Contain("A request was sent to a polling endpoint, but the polling endpoint did not collect the request within the allowed time (00:00:05), so the request timed out. Please check the tentacle logs to investigate this timeout.");
exception.ConnectionState.Should().Be(ConnectionState.Connecting);

stopwatch.Stop();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public async Task QueueAndWait_WhenPollingRequestQueueTimeoutIsReached_WillStopW
// Although we sleep for 1 second, sometimes it can be just under. So be generous with the buffer.
stopwatch.Elapsed.Should().BeGreaterThan(TimeSpan.FromMilliseconds(800));
response.Id.Should().Be(request.Id);
response.Error!.Message.Should().Be("A request was sent to a polling endpoint, but the polling endpoint did not collect the request within the allowed time (00:00:01), so the request timed out.");
response.Error!.Message.Should().Be("A request was sent to a polling endpoint, but the polling endpoint did not collect the request within the allowed time (00:00:01), so the request timed out. Please check the tentacle logs to investigate this timeout.");

var next = await sut.DequeueAsync(CancellationToken);
next.Should().BeNull();
Expand Down Expand Up @@ -123,7 +123,7 @@ public async Task QueueAndWait_WithRelyOnConnectionTimeoutsInsteadOfPollingReque
// Although we sleep for 1 second, sometimes it can be just under. So be generous with the buffer.
stopwatch.Elapsed.Should().BeGreaterThan(TimeSpan.FromMilliseconds(800));
response.Id.Should().Be(request.Id);
response.Error!.Message.Should().Be("A request was sent to a polling endpoint, but the polling endpoint did not collect the request within the allowed time (00:00:01), so the request timed out.");
response.Error!.Message.Should().Be("A request was sent to a polling endpoint, but the polling endpoint did not collect the request within the allowed time (00:00:01), so the request timed out. Please check the tentacle logs to investigate this timeout.");

var next = await sut.DequeueAsync(CancellationToken);
next.Should().BeNull();
Expand Down
2 changes: 1 addition & 1 deletion source/Halibut/ServiceModel/PendingRequestQueueAsync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ public async Task WaitUntilComplete(CancellationToken cancellationToken)
log.Write(EventType.MessageExchange, "Request {0} timed out before it could be collected by the polling endpoint", request);
SetResponse(ResponseMessage.FromException(
request,
new TimeoutException($"A request was sent to a polling endpoint, but the polling endpoint did not collect the request within the allowed time ({request.Destination.PollingRequestQueueTimeout}), so the request timed out."),
new TimeoutException($"A request was sent to a polling endpoint, but the polling endpoint did not collect the request within the allowed time ({request.Destination.PollingRequestQueueTimeout}), so the request timed out. Please check the tentacle logs to investigate this timeout."),
ConnectionState.Connecting));
}
}
Expand Down