diff --git a/src/Tests/Grand.Web.Common.Tests/Infrastructure/BackgroundServiceTaskTests.cs b/src/Tests/Grand.Web.Common.Tests/Infrastructure/BackgroundServiceTaskTests.cs index c051b279f..4b5bef7d5 100644 --- a/src/Tests/Grand.Web.Common.Tests/Infrastructure/BackgroundServiceTaskTests.cs +++ b/src/Tests/Grand.Web.Common.Tests/Infrastructure/BackgroundServiceTaskTests.cs @@ -336,8 +336,10 @@ public async Task ExecuteAsync_RenewalsKeepFailing_CancelsTheRunBeforeTheLeaseRu } }); - var service = new BackgroundServiceTask(TaskName, _serviceProvider, TimeSpan.FromMilliseconds(200), - TimeSpan.FromSeconds(1)); + //the run stops one renewal interval before the lease runs out; the delays between renewals may each come + //late on a busy machine, so the interval leaves room for that + var service = new BackgroundServiceTask(TaskName, _serviceProvider, TimeSpan.FromMilliseconds(500), + TimeSpan.FromSeconds(2)); using var cts = new CancellationTokenSource(); await service.StartAsync(cts.Token);