test: replace final fixed-delay oracles
This commit is contained in:
parent
ad7ebe9425
commit
79a4489e03
6 changed files with 101 additions and 21 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue