diff --git a/code/DeltaKustoAdxIntegrationTest/AdxDbTestHelper.cs b/code/DeltaKustoAdxIntegrationTest/AdxDbTestHelper.cs index 1f67325..bd3ffc0 100644 --- a/code/DeltaKustoAdxIntegrationTest/AdxDbTestHelper.cs +++ b/code/DeltaKustoAdxIntegrationTest/AdxDbTestHelper.cs @@ -116,6 +116,7 @@ public async Task> GetDbsAsync(int dbCount) } // Not enough db available: let's wait for some! await newDbEvent.Task; + // Change the event for a fresh one Interlocked.CompareExchange( ref _newDbEvent, new TaskCompletionSource(), @@ -142,7 +143,7 @@ public void ReleaseDbs(IEnumerable dbNames) _availableDbNames.AddRange(dbNames); } // Pop event for waiting threads - _newDbEvent.SetResult(); + _newDbEvent.TrySetResult(); } void IDisposable.Dispose()