Further work to stabilize the integration test interop layer#25455
Further work to stabilize the integration test interop layer#25455sharwell merged 8 commits intodotnet:dev15.7.xfrom
Conversation
6ef54ea to
a4e53e7
Compare
a4e53e7 to
08fee02
Compare
|
Looks like 54330a6 only fixed half the problem with figuring out what exception is thrown. Before my change we got this exception: After my change in 54330a6 we got this exception: Now I've switch to just using |
|
|
||
| private static void RetryIfNotAvailable<T>(Action<T> action, T state) | ||
| { | ||
| for (var i = 0; true; i++) |
There was a problem hiding this comment.
true [](start = 28, length = 4)
I'd rather you make this explicitly i < AutomationRetryCount, and throw an unreachable exception after the try/catch. It took me a minute of verifying exit conditions to actually be sure this wasn't an infinite loop, and that pattern will much easier to reason about your expectations.
There was a problem hiding this comment.
💭 The issue I encountered here is it doesn't change the way the exception filter is used, so technically such a change would increase the cyclomatic complexity of the method but not actually add any reachable paths.
There was a problem hiding this comment.
It might increase some complexity of the method, but imo would result in code that is more easily understandable and verifiable.
In reply to: 178400103 [](ancestors = 178400103)
There was a problem hiding this comment.
➡️ I went with a documentation approach instead. Hopefully it's enough to make it reasonably clear.
| var view = GetActiveTextView(); | ||
| var broker = GetComponentModel().GetService<ILightBulbBroker>(); | ||
| return GetLightBulbActions(broker, view).Select(a => a.DisplayText).ToArray(); | ||
| return (await GetLightBulbActionsAsync(broker, view)).Select(a => a.DisplayText).ToArray(); |
There was a problem hiding this comment.
Missing a few explicit ConfigureAwaits in this file.
| if (blockUntilComplete) | ||
| { | ||
| BeginInvokeExecuteOnActiveView(lightBulbAction); | ||
| task.Join(); |
There was a problem hiding this comment.
Is there a way to add an assert here that we're not currently on the main thread?
There was a problem hiding this comment.
➡️ This is JoinableTask.Join; there is no caller affinity restriction.
The implementations of ISuggestedAction use threading assertions instead of automatic transition to the correct thread, placing the burden of correct thread selection on the caller, TextViewWindow_InProc. This change switches to the vs-threading approach for maintaining thread affinity, which has two parts: 1. When entering thread-affinitized code, switch to the correct thread 2. Avoid using ConfigureAwait(false) to lose the required affinity The entire file relies on the default behavior of ConfigureAwait, which is the normal coding practice in asynchronous code following vs-threading patterns.
|
💭 Failure in CSharpCodeActions.GenerateMethodInClosedFile looks a code action is incorrectly reporting that it has no changes to apply (empty preview). |

IMessageFilterfor consistent COM retry semanticsMakeDebugAssertFailureExceptionserializableHostWaitHelperThrowingTraceListeneruseInvalidOperationExceptioninstead ofDebugAssertFailureException