Skip to content

Commit

Permalink
Attempt alternate workaround for CI race
Browse files Browse the repository at this point in the history
  • Loading branch information
mhutch committed Sep 25, 2024
1 parent 9c106a6 commit 6d01c4d
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion Editor.Tests/Extensions/CommandServiceExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,22 @@ public static void CheckAndExecute<T> (
LogTrace ("Session open");
RegisterTraceHandlers (session);
}
// If we have a session, but it hasn't started yet, wait for it to start.
// We previously called session.GetComputedItems to wait for the completion
// to be updated, but on slow machines, e.g. on CI, this could cause completion
// to be dismissed (TryDismissSafelyAsync) before it was even shown.
if (session is IAsyncCompletionSessionOperations sessionOperations) {
// wait up to 2.5 seconds in 25ms intervals
for (int i = 0; i < 100; i++) {
if (sessionOperations.IsStarted) {
break;
}
Thread.Sleep (25);
}
}

//ensure the computation is completed before we continue typing
session.GetComputedItems (CancellationToken.None);
//session.GetComputedItems (CancellationToken.None);
LogTrace ("Session open");
}
} else{
Expand Down

0 comments on commit 6d01c4d

Please sign in to comment.