test: replace final fixed-delay oracles

This commit is contained in:
Erik 2026-08-18 13:12:26 +02:00
parent ad7ebe9425
commit 79a4489e03
6 changed files with 101 additions and 21 deletions

View file

@ -22,7 +22,8 @@ internal sealed class InstallerTransactionLease : IAsyncDisposable
internal static async ValueTask<InstallerTransactionLease> AcquireAsync(
string dataDirectory,
CancellationToken cancellationToken = default)
CancellationToken cancellationToken = default,
Action? contentionObserved = null)
{
string lockPath = GetLockPath(dataDirectory);
Directory.CreateDirectory(
@ -46,6 +47,7 @@ internal sealed class InstallerTransactionLease : IAsyncDisposable
}
catch (IOException)
{
contentionObserved?.Invoke();
await Task.Delay(RetryDelay, cancellationToken)
.ConfigureAwait(false);
}