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

VS2022 Preview (17.11.0 Preview 2.0): Exception: "Support for Windows containers in Docker is not enabled." when trying to access windows container #5106

Open
bevanweiss opened this issue Jun 18, 2024 · 4 comments

Comments

@bevanweiss
Copy link

Description

I've got a solution with an xUnit Test project within it.
I've configured a testenvironments.json file as below

{
    "version": "1",
    "environments": [
        {
            "name": "Windows ltsc2022",
            "type": "docker",
            "dockerFile": "../../../testdocker/Dockerfile"
        }
    ]
}

and then I have a Dockerfile that is incredibly naive... but should be ok for now (it's to test MSI packages, so nothing beyond base OS is required)

# Use the latest Windows Server Core 2022 image.
FROM mcr.microsoft.com/windows/servercore:ltsc2022

Steps to reproduce

When I open the Test Explorer, all looks good, and I can see the remote container in the drop down list.
image

However when I select the remote container, it generates an exception telling me that support for Windows containers in Docker is not enabled..
image

However if I go to a command line, I can run that Docker file without a problem
image

Expected behavior

I expect the Visual Studio Test Runner to launch the (Windows) docker container, and to connect to it.
Which would then allow for the Test Suite to be run from inside the container.

Actual behavior

Docker container is not started.
Misleading diagnostic message "Connected to test environment..." is displayed.
Exception and stack trace is reported, again with misleading information suggesting the problem is the Docker application setup.

Diagnostic logs

Connected to test environment 'Windows ltsc2022'
System.Exception: Support for Windows containers in Docker is not enabled.
at Microsoft.VisualStudio.TestWindow.Host.TestPlatformProviders.DockerTestPlatformProvider.d__17.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.TestWindow.Host.TestPlatformAgentPool.<>c__DisplayClass24_0.<b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.TestWindow.Utilities.EventPumpExtensions.<>c__DisplayClass4_01.<<EnqueueAsync>b__1>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.TestWindow.Extensibility.TaskCompletionSourceExtensions.<RunTaskWithCatchAsync>d__11.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.TestWindow.Logging.ILoggerExtensions.d__131.MoveNext() System.Exception: Support for Windows containers in Docker is not enabled. at Microsoft.VisualStudio.TestWindow.Host.TestPlatformProviders.DockerTestPlatformProvider.<ActivateSessionAsync>d__17.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.TestWindow.Host.TestPlatformAgentPool.<>c__DisplayClass24_0.<<CreateRemoteAgentAsync>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.TestWindow.Utilities.EventPumpExtensions.<>c__DisplayClass4_01.<b__1>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.TestWindow.Extensibility.TaskCompletionSourceExtensions.d__11.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.TestWindow.Logging.ILoggerExtensions.<CallWithCatchAsync>d__131.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.TestWindow.Host.TestPlatformProvider.d__13.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.TestWindow.Logging.ILoggerExtensions.d__14`1.MoveNext()

Environment

Windows 11 22H2 (OS Build 22621.3737)
VSTest version 17.11.0-preview-24263-02 (x64)
Docker Desktop 4.31.1 (153621)

@bevanweiss bevanweiss changed the title VS2022 Preview (17.11.0 Preview 2.0): Support for Windows containers in Docker is not enabled. Exception when trying to access windows container VS2022 Preview (17.11.0 Preview 2.0): Exception: "Support for Windows containers in Docker is not enabled." when trying to access windows container Jun 18, 2024
@nohwnd
Copy link
Member

nohwnd commented Jun 18, 2024

@peterwald please have a look, this seems specific to TE and the functionality you worked on.

@peterwald
Copy link
Member

We don't currently enable support for remote testing in Windows containers in Docker, only Linux containers.

There are quite a few technical differences that make it difficult to maintain and we have been seeking feedback from our users as to whether it would be worthwhile to invest in.

/cc @AbhitejJohn

@bevanweiss
Copy link
Author

@peterwald Is there any estimate for when Test runs in Windows (amd64 on amd64) Containers would be available for early testing?
It'd be nice if rather than crashing out with an Exception, it provided a large warning text (both top and bottom of the console sequence).. but then did attempt to do stuff (at least launching the container would have been expected).

My particular test case is MSI deployments, where there are .NET 'tests' which validate certain aspects of the MSI deployments within the container (so that restoring to reproducible state is trivial).

@nohwnd
Copy link
Member

nohwnd commented Jul 8, 2024

@peterwald @AbhitejJohn please link a ticket (if you have one) where you are collecting this feedback, so we can close this issue here. 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants