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

Intermittent test hang: Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.Interactive.Commands.InteractiveCommandHandlerTests #21563

Closed
tmat opened this issue Aug 16, 2017 · 3 comments
Assignees
Labels
Area-Interactive Flaky Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented Test Test failures in roslyn-CI
Milestone

Comments

@tmat
Copy link
Member

tmat commented Aug 16, 2017

mscorlib.dll!System.Threading.Tasks.Task.Wait(int millisecondsTimeout, System.Threading.CancellationToken cancellationToken) Line 3167	C#	Symbols loaded.
Microsoft.CodeAnalysis.InteractiveEditorFeatures.dll!Microsoft.CodeAnalysis.Editor.Interactive.AbstractSendToInteractiveSubmissionProvider.Microsoft.CodeAnalysis.Editor.Interactive.ISendToInteractiveSubmissionProvider.GetSelectedText(Microsoft.VisualStudio.Text.Editor.IEditorOptions editorOptions, Microsoft.CodeAnalysis.Editor.CommandArgs args, System.Threading.CancellationToken cancellationToken)	Unknown	No symbols loaded.
 	Microsoft.CodeAnalysis.InteractiveEditorFeatures.dll!Microsoft.CodeAnalysis.Editor.Interactive.InteractiveCommandHandler.GetSelectedText(Microsoft.CodeAnalysis.Editor.CommandArgs args, System.Threading.CancellationToken cancellationToken)	Unknown	No symbols loaded.
 	Microsoft.CodeAnalysis.InteractiveEditorFeatures.dll!Microsoft.CodeAnalysis.Editor.Interactive.InteractiveCommandHandler.Microsoft.CodeAnalysis.Editor.ICommandHandler<Microsoft.CodeAnalysis.Editor.Commands.ExecuteInInteractiveCommandArgs>.ExecuteCommand.AnonymousMethod__0(Microsoft.CodeAnalysis.Editor.Host.IWaitContext context)	Unknown	No symbols loaded.
 	Roslyn.Services.Test.Utilities.dll!Microsoft.CodeAnalysis.Editor.UnitTests.Utilities.TestWaitIndicator.Microsoft.CodeAnalysis.Editor.Host.IWaitIndicator.Wait(string title, string message, bool allowCancel, bool showProgress, System.Action<Microsoft.CodeAnalysis.Editor.Host.IWaitContext> action)	Unknown	No symbols loaded.
 	Microsoft.CodeAnalysis.InteractiveEditorFeatures.dll!Microsoft.CodeAnalysis.Editor.Interactive.InteractiveCommandHandler.Microsoft.CodeAnalysis.Editor.ICommandHandler<Microsoft.CodeAnalysis.Editor.Commands.ExecuteInInteractiveCommandArgs>.ExecuteCommand(Microsoft.CodeAnalysis.Editor.Commands.ExecuteInInteractiveCommandArgs args, System.Action nextHandler)	Unknown	No symbols loaded.
 	Roslyn.VisualStudio.CSharp.UnitTests.dll!Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.Interactive.Commands.InteractiveWindowCommandHandlerTestState.ExecuteInInteractive()	Unknown	No symbols loaded.
 	Roslyn.VisualStudio.CSharp.UnitTests.dll!Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.Interactive.Commands.InteractiveCommandHandlerTests.AssertExecuteInInteractive(string code, string[] expectedSubmissions, string submissionBuffer)	Unknown	No symbols loaded.
 	Roslyn.VisualStudio.CSharp.UnitTests.dll!Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.Interactive.Commands.InteractiveCommandHandlerTests.AssertExecuteInInteractive(string code, string expectedSubmission, string submissionBuffer)	Unknown	No symbols loaded.
 	Roslyn.VisualStudio.CSharp.UnitTests.dll!Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.Interactive.Commands.InteractiveCommandHandlerTests.TestExecuteInInteractiveWithoutSelection()	Unknown	No symbols loaded.

Memory dump: %internal_share%\public\tomat\Bugs\21563

@333fred
Copy link
Member

333fred commented Aug 17, 2017

Another dump at %internal_share%\public\frsilb\dumps\interactive_unit_test_hang

@jasonmalinowski
Copy link
Member

@jinujoseph Can we get this assigned out? A quick inspection shows a likely offending line is here:

where that .ConfigureAwait(true) means we'll schedule back on to the test thread and then deadlock. It'd result in product hangs too. I'm unfamiliar with the code specifically but it might be as easy as switching to .ConfigureAwait(false) assuming there isn't a reason that has to jump back to the same thread. Even better, since this all seems like stuff that's intended to run on the UI thread might be to avoid using the async pattern otherwise we're blocking the UI thread on thread pool work.

@jasonmalinowski
Copy link
Member

This hit another PR today too. @tmat can you verify if ConfigureAwait(false) is at least sufficient here?

@jinujoseph jinujoseph modified the milestones: 15.5, 15.6, Unknown Oct 31, 2017
jasonmalinowski added a commit to jasonmalinowski/roslyn that referenced this issue Feb 13, 2018
These tasks are being waited for with a .WaitAndGetResult(); using
.ConfigureAwait(true) means if they don't run synchronously then
we will schedule something to the UI thread while simultaneously
blocking the thread. That will deadlock the product, and also tests.
Turns out the latter happens on a semi-regular basis.

Fixes dotnet#21563.
@jinujoseph jinujoseph assigned jasonmalinowski and unassigned tmat Feb 14, 2018
@jinujoseph jinujoseph modified the milestones: Unknown, 15.7 Feb 14, 2018
@jinujoseph jinujoseph added the 4 - In Review A fix for the issue is submitted for review. label Feb 14, 2018
@sharwell sharwell added Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented and removed 4 - In Review A fix for the issue is submitted for review. labels Feb 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Interactive Flaky Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented Test Test failures in roslyn-CI
Projects
None yet
Development

No branches or pull requests

5 participants