Skip to content

Commit 249cf9a

Browse files
committed
Ensures usage service timeout is asserted
Changes the usage service test to explicitly assert that a timeout exception is thrown when the countdown timer expires. This improves the reliability and clarity of the test by ensuring that the expected behavior is verified.
1 parent ba9b5b5 commit 249cf9a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/Exceptionless.Tests/Services/UsageServiceTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ await messageBus.SubscribeAsync<PlanOverage>(po =>
5252

5353
int totalToIncrement = eventsLeftInBucket - 1;
5454
await _usageService.IncrementTotalAsync(organization.Id, project.Id, totalToIncrement);
55-
await countdown.WaitAsync(TimeSpan.FromMilliseconds(150));
55+
await Assert.ThrowsAsync<TimeoutException>(async () => await countdown.WaitAsync(TimeSpan.FromMilliseconds(150)));
5656
Assert.Equal(2, countdown.CurrentCount);
5757

5858
int eventsLeft = await _usageService.GetEventsLeftAsync(organization.Id);

0 commit comments

Comments
 (0)