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

Increase timeout to make subsystem tests more reliable #18380

Merged
merged 2 commits into from
Oct 25, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/xUnit/csharp/test_Feedback.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public static void GetFeedback()
// Expect the result from 'General' only because the 'slow' one cannot finish before the specified timeout.
// The specified timeout is exaggerated to make the test reliable.
// xUnit must spin up a lot tasks, which makes the test unreliable when the time difference between 'delay' and 'timeout' is small.
var feedbacks = FeedbackHub.GetFeedback(pwsh.Runspace, millisecondsTimeout: 1000);
var feedbacks = FeedbackHub.GetFeedback(pwsh.Runspace, millisecondsTimeout: 1500);
string expectedCmd = Path.Combine(".", "feedbacktest");

// Test the result from the 'General' feedback provider.
Expand Down
4 changes: 2 additions & 2 deletions test/xUnit/csharp/test_Prediction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public static void PredictInput()
// cannot finish before the specified timeout.
// The specified timeout is exaggerated to make the test reliable.
// xUnit must spin up a lot tasks, which makes the test unreliable when the time difference between 'delay' and 'timeout' is small.
results = CommandPrediction.PredictInputAsync(predClient, ast, tokens, millisecondsTimeout: 1000).Result;
results = CommandPrediction.PredictInputAsync(predClient, ast, tokens, millisecondsTimeout: 1500).Result;
Assert.Single(results);

PredictionResult res = results[0];
Expand Down Expand Up @@ -214,7 +214,7 @@ public static void Feedback()
slow.DisplayedSuggestions.Count == 0 || fast.DisplayedSuggestions.Count == 0 ||
slow.AcceptedSuggestions.Count == 0)
{
Thread.Sleep(100);
Thread.Sleep(300);
}

Assert.Equal(2, slow.History.Count);
Expand Down