[BUG] Playwright.CreateAsync() is hanging when it's executed by GitHub runner via vstest.console.exe
See original GitHub issueContext:
- Playwright Version: 1.31.1
- Operating System: Windows
- .NET version: .NET Framework 4.7.2
- Browser: Not applicable because it’s hanging before any browser interaction
- Extra:
Please find repro: https://github.com/op-13/pwtest
Code Snippet
The simple test solution is using VSTest and a simple GitHub actions workflow. The single file has only a dummy test:
[TestClass]
public class SimpleTestWithPlaywright
{
[TestMethod]
public async Task TestMethod1()
{
using (var instance = await Playwright.CreateAsync()) // it is hanging in the CreateAsync() call
{
Assert.AreEqual(1, 1); // we will never reach this point when the GitHub runner executes this
}
}
}
The relevant part of the yaml workflow:
- name: Run tests
shell: powershell
run: |
. "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe" (Get-ChildItem $currentDirectory -include *.dll -recurse | where {$_.name -match "SimpleTest.dll" -and $_.Directory -notMatch '.*\\obj\\.*'}).FullName
Describe the bug
The bug is that the code is hanging when it’s being executed by the GitHub runner: link to a sample workflow run I have to cancel this manually otherwise it would run for hours (until it times out).
If I run the same command from the machine of the runner, it works fine:
It doesn’t make any difference if I run the GitHub runner in an Administrator command prompt or not (or as a service). Tested on 5 different machines, including installations of Windows Server 2019 Standard and a home installation of Windows 10 Pro. Our tests included executing the runner on behalf of gMSA, as well as normal user accounts (all of them were admins).
Also we tried to use Microsoft’s VSTest-action, it was still hanging.
Issue Analytics
- State:
- Created 6 months ago
- Reactions:3
- Comments:18 (6 by maintainers)
Thank you for looking into this. Glad to read you were able to reproduce the issue.
Maybe there is something specific to the configuration.
Regarding Playwright versions, I also tried playwright-dotnet 1.17.3 - our product didn’t have the latest version so I first tried with that one, without upgrading. Same behaviour.
However I talked to my colleague who found this commit: https://github.com/microsoft/playwright-dotnet/commit/17debcd5bbc58cfe529017077d62a7572e5d87ba. He says he tried with the playwright-dotnet version 1.14.0 which doesn’t contain this commit. He says when the runner executes our test suite with that version (I mean tests not in this simple repo, but in our real, internal one), then it gets past that
CreateAsync()
line… and it hangs at a later step.I didn’t test with that version, so I cannot confirm this. Maybe you guys can give it a look please?
I was briefly looking into that commit and trying to find anything which can be relevant to our setup, but as I’m not familiar with your codebase, I couldn’t find anything so far.
Created a writeup here with some smaller reproducible: https://github.com/mxschmitt/dotnet-batch-childprocess-adds-bom Will discuss with the team which workaround we will implement.