Skip to content

Commit

Permalink
Mark tests inconclusive if indexer status times out (#14727)
Browse files Browse the repository at this point in the history
  • Loading branch information
heaths authored Sep 1, 2020
1 parent 066e4a9 commit b92a616
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -348,15 +348,7 @@ public async Task CreateIndexerAsync()
cleanUpTasks.Push(() => indexerClient.DeleteIndexerAsync(indexerName));

// Wait till the indexer is done.
try
{
await WaitForIndexingAsync(indexerClient, indexerName);
}
catch (TaskCanceledException)
{
// TODO: Remove this when we figure out a more correlative way of checking status.
Assert.Inconclusive("Timed out while waiting for the indexer to complete");
}
await WaitForIndexingAsync(indexerClient, indexerName);

#region Snippet:Azure_Search_Tests_Samples_CreateIndexerAsync_Query
// Get a SearchClient from the SearchIndexClient to share its pipeline.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,20 @@ protected async Task WaitForIndexingAsync(

while (true)
{
await DelayAsync(delay, cancellationToken: cts.Token);
SearchIndexerStatus status = null;
try
{
await DelayAsync(delay, cancellationToken: cts.Token);

SearchIndexerStatus status = await client.GetIndexerStatusAsync(
indexerName,
cancellationToken: cts.Token);
status = await client.GetIndexerStatusAsync(
indexerName,
cancellationToken: cts.Token);
}
catch (TaskCanceledException)
{
// TODO: Remove this when we figure out a more correlative way of checking status.
Assert.Inconclusive("Timed out while waiting for the indexer to complete");
}

if (status.Status == IndexerStatus.Running)
{
Expand Down

0 comments on commit b92a616

Please sign in to comment.