diff --git a/sdk/search/Azure.Search.Documents/tests/Batching/AsyncEventExtensionsTests.cs b/sdk/search/Azure.Search.Documents/tests/Batching/AsyncEventExtensionsTests.cs index 37d722f81501c..bdadf33799628 100644 --- a/sdk/search/Azure.Search.Documents/tests/Batching/AsyncEventExtensionsTests.cs +++ b/sdk/search/Azure.Search.Documents/tests/Batching/AsyncEventExtensionsTests.cs @@ -423,8 +423,8 @@ await Task.WhenAll( public async Task Cancels_OnlySlow() { TestHandler first = new TestHandler() { Delay = TimeSpan.FromMilliseconds(20) }; - TestHandler second = new TestHandler() { Delay = TimeSpan.FromMilliseconds(200) }; - TestHandler third = new TestHandler() { Delay = TimeSpan.FromMilliseconds(200) }; + TestHandler second = new TestHandler() { Delay = TimeSpan.FromMilliseconds(500) }; + TestHandler third = new TestHandler() { Delay = TimeSpan.FromMilliseconds(500) }; CancellationTokenSource cancellation = new CancellationTokenSource(); Func handler = null; diff --git a/sdk/search/Azure.Search.Documents/tests/Samples/Sample05_IndexingDocuments.cs b/sdk/search/Azure.Search.Documents/tests/Samples/Sample05_IndexingDocuments.cs index 19b43694505ba..7ace5309f00ac 100644 --- a/sdk/search/Azure.Search.Documents/tests/Samples/Sample05_IndexingDocuments.cs +++ b/sdk/search/Azure.Search.Documents/tests/Samples/Sample05_IndexingDocuments.cs @@ -121,6 +121,13 @@ public async Task SimpleIndexing() await WaitForDocumentCountAsync(searchClient, 1000); + // When using the free SKU, there may be enough load to prevent + // immediately replication to all replicas and we get back the + // wrong count. Wait another second before checking again. We + // may also upgrade to a basic SKU, but that will take longer + // to provision. + await DelayAsync(TimeSpan.FromSeconds(1)); + // Check #region Snippet:Azure_Search_Documents_Tests_Samples_Sample05_IndexingDocuments_SimpleIndexing2 Assert.AreEqual(1000, (int)await searchClient.GetDocumentCountAsync());