Skip to content

Commit

Permalink
Stabilize unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
petar-m committed Jun 27, 2024
1 parent d4687da commit f6fd89e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/M.EventBrokerSlim/Internal/RetryQueue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ private static async Task Poll(object state)

self._polling = true;
self._semaphore.Release();
await Task.Delay(TimeSpan.FromMilliseconds(50), self._cancellationToken).ConfigureAwait(false);
await Task.Delay(TimeSpan.FromMilliseconds(25), self._cancellationToken).ConfigureAwait(false);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ public async Task OnError_Overrides_Handle_RetryPolicy_Delay(int maxConcurrentHa

var eventBroker = scope.ServiceProvider.GetRequiredService<IEventBroker>();
var eventsTracker = scope.ServiceProvider.GetRequiredService<EventsTracker>();
eventsTracker.ExpectedItemsCount = 2;
var event1 = new TestEvent("test");

// Act
await eventBroker.Publish(event1);
await eventsTracker.Wait(TimeSpan.FromSeconds(1));
await eventsTracker.Wait(TimeSpan.FromSeconds(2));

// Assert
Assert.Equal(2, eventsTracker.Items.Count);
Expand Down

0 comments on commit f6fd89e

Please sign in to comment.