Skip to content

Commit e8b6438

Browse files
committed
Fixed flaky test
1 parent a98ef82 commit e8b6438

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

tests/Cloudflare.NET.Tests/IntegrationTests/KvApiIntegrationTests.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -645,11 +645,15 @@ public async Task BulkDeleteAsync_CanDeleteMultipleKeys()
645645
result.SuccessfulKeyCount.Should().Be(3);
646646
result.UnsuccessfulKeys.Should().BeNullOrEmpty();
647647

648-
// Verify they are deleted
648+
// Verify they are deleted (retry for eventual consistency - no delays, just retries)
649+
const int maxRetries = 10;
649650
foreach (var key in keys)
650651
{
651-
var value = await _sut.GetValueAsync(_namespaceId, key);
652-
value.Should().BeNull($"{key} should be deleted");
652+
string? value = "not null";
653+
for (var attempt = 1; attempt <= maxRetries && value is not null; attempt++)
654+
value = await _sut.GetValueAsync(_namespaceId, key);
655+
656+
value.Should().BeNull($"{key} should be deleted after {maxRetries} retries");
653657
}
654658
}
655659

0 commit comments

Comments
 (0)