From 4b252a8d42ce460ac703393779d90fa7cddce3e1 Mon Sep 17 00:00:00 2001 From: akhera99 Date: Thu, 18 Sep 2025 14:59:13 -0700 Subject: [PATCH 1/2] add timeout when getting controldatasource --- .../CSharp/CSharpReplIdeFeatures.cs | 12 ++++++------ .../New.IntegrationTests/InProcess/ShellInProcess.cs | 3 ++- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/VisualStudio/IntegrationTest/New.IntegrationTests/CSharp/CSharpReplIdeFeatures.cs b/src/VisualStudio/IntegrationTest/New.IntegrationTests/CSharp/CSharpReplIdeFeatures.cs index ac5036da0f0ee..90419a6f50a95 100644 --- a/src/VisualStudio/IntegrationTest/New.IntegrationTests/CSharp/CSharpReplIdeFeatures.cs +++ b/src/VisualStudio/IntegrationTest/New.IntegrationTests/CSharp/CSharpReplIdeFeatures.cs @@ -85,7 +85,7 @@ public async Task HighlightRefsSingleSubmissionVerifyRenameTagsGoAway() } [IdeFact] - public async Task HighlightRefsMultipleSubmisionsVerifyRenameTagsShowUpWhenInvokedOnSubmittedText() + public async Task HighlightRefsMultipleSubmissionsVerifyRenameTagsShowUpWhenInvokedOnSubmittedText() { await TestServices.InteractiveWindow.SubmitTextAsync("class Goo { }", HangMitigatingCancellationToken); await TestServices.InteractiveWindow.SubmitTextAsync("Goo something = new Goo();", HangMitigatingCancellationToken); @@ -97,7 +97,7 @@ public async Task HighlightRefsMultipleSubmisionsVerifyRenameTagsShowUpWhenInvok } [IdeFact] - public async Task HighlightRefsMultipleSubmisionsVerifyRenameTagsShowUpOnUnsubmittedText() + public async Task HighlightRefsMultipleSubmissionsVerifyRenameTagsShowUpOnUnsubmittedText() { await TestServices.InteractiveWindow.SubmitTextAsync("class Goo { }", HangMitigatingCancellationToken); await TestServices.InteractiveWindow.SubmitTextAsync("Goo something = new Goo();", HangMitigatingCancellationToken); @@ -109,7 +109,7 @@ public async Task HighlightRefsMultipleSubmisionsVerifyRenameTagsShowUpOnUnsubmi } [IdeFact] - public async Task HighlightRefsMultipleSubmisionsVerifyRenameTagsShowUpOnTypesWhenInvokedOnSubmittedText() + public async Task HighlightRefsMultipleSubmissionsVerifyRenameTagsShowUpOnTypesWhenInvokedOnSubmittedText() { await TestServices.InteractiveWindow.SubmitTextAsync("class Goo { }", HangMitigatingCancellationToken); await TestServices.InteractiveWindow.SubmitTextAsync("Goo a;", HangMitigatingCancellationToken); @@ -121,7 +121,7 @@ public async Task HighlightRefsMultipleSubmisionsVerifyRenameTagsShowUpOnTypesWh } [IdeFact] - public async Task HighlightRefsMultipleSubmisionsVerifyRenameTagsShowUpOnTypesWhenInvokedOnUnsubmittedText() + public async Task HighlightRefsMultipleSubmissionsVerifyRenameTagsShowUpOnTypesWhenInvokedOnUnsubmittedText() { await TestServices.InteractiveWindow.SubmitTextAsync("class Goo { }", HangMitigatingCancellationToken); await TestServices.InteractiveWindow.SubmitTextAsync("Goo a;", HangMitigatingCancellationToken); @@ -133,7 +133,7 @@ public async Task HighlightRefsMultipleSubmisionsVerifyRenameTagsShowUpOnTypesWh } [IdeFact] - public async Task HighlightRefsMultipleSubmisionsVerifyRenameTagsGoAwayWhenInvokedOnUnsubmittedText() + public async Task HighlightRefsMultipleSubmissionsVerifyRenameTagsGoAwayWhenInvokedOnUnsubmittedText() { await TestServices.InteractiveWindow.SubmitTextAsync("class Goo { }", HangMitigatingCancellationToken); await TestServices.InteractiveWindow.SubmitTextAsync("Goo a;", HangMitigatingCancellationToken); @@ -145,7 +145,7 @@ public async Task HighlightRefsMultipleSubmisionsVerifyRenameTagsGoAwayWhenInvok } [IdeFact] - public async Task HighlightRefsMultipleSubmisionsVerifyRenameTagsOnRedefinedVariable() + public async Task HighlightRefsMultipleSubmissionsVerifyRenameTagsOnRedefinedVariable() { await TestServices.InteractiveWindow.SubmitTextAsync("string abc = null;", HangMitigatingCancellationToken); await TestServices.InteractiveWindow.SubmitTextAsync("abc = string.Empty;", HangMitigatingCancellationToken); diff --git a/src/VisualStudio/IntegrationTest/New.IntegrationTests/InProcess/ShellInProcess.cs b/src/VisualStudio/IntegrationTest/New.IntegrationTests/InProcess/ShellInProcess.cs index 91d7d95dd1358..d707af1b8b372 100644 --- a/src/VisualStudio/IntegrationTest/New.IntegrationTests/InProcess/ShellInProcess.cs +++ b/src/VisualStudio/IntegrationTest/New.IntegrationTests/InProcess/ShellInProcess.cs @@ -17,6 +17,7 @@ using Microsoft.VisualStudio.Shell; using Microsoft.VisualStudio.Shell.Interop; using Microsoft.VisualStudio.Threading; +using Roslyn.Test.Utilities; using Xunit; using IAsyncDisposable = System.IAsyncDisposable; @@ -100,7 +101,7 @@ private async Task ExecuteRemotableCommandAsync(string commandName, Cancellation ErrorHandler.ThrowOnFailure(commandService.GetControlDataSourceAsync( (uint)__VSCOMMANDTYPES.cCommandTypeButton, commandName, - timeout: 0, + timeout: TestHelpers.HangMitigatingTimeout.Milliseconds, out var dataSourceTask)); Assumes.NotNull(dataSourceTask); From acf8f04d6fe5c7ac5453a6ded2ee6f4f90176f7f Mon Sep 17 00:00:00 2001 From: akhera99 Date: Thu, 18 Sep 2025 15:57:29 -0700 Subject: [PATCH 2/2] fix --- .../New.IntegrationTests/InProcess/ShellInProcess.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/VisualStudio/IntegrationTest/New.IntegrationTests/InProcess/ShellInProcess.cs b/src/VisualStudio/IntegrationTest/New.IntegrationTests/InProcess/ShellInProcess.cs index d707af1b8b372..c7a66d0ce0354 100644 --- a/src/VisualStudio/IntegrationTest/New.IntegrationTests/InProcess/ShellInProcess.cs +++ b/src/VisualStudio/IntegrationTest/New.IntegrationTests/InProcess/ShellInProcess.cs @@ -101,7 +101,7 @@ private async Task ExecuteRemotableCommandAsync(string commandName, Cancellation ErrorHandler.ThrowOnFailure(commandService.GetControlDataSourceAsync( (uint)__VSCOMMANDTYPES.cCommandTypeButton, commandName, - timeout: TestHelpers.HangMitigatingTimeout.Milliseconds, + timeout: ((int)TestHelpers.HangMitigatingTimeout.TotalMilliseconds), out var dataSourceTask)); Assumes.NotNull(dataSourceTask);