Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark tests inconclusive if indexer status times out #14727

Merged
merged 1 commit into from
Sep 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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