question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Playwright.CreateAsync() is hanging when it's executed by GitHub runner via vstest.console.exe

See original GitHub issue

Context:

  • 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:

image

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:closed
  • Created 6 months ago
  • Reactions:3
  • Comments:18 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
op-13commented, Mar 28, 2023

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.

0reactions
mxschmittcommented, Jul 26, 2023

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[BUG?] The test run hangs and loses response at a random ...
33.0 to v1.35.1, I notice that the test execution will hang at a random test case and lose response unless you kill the...
Read more >
[BUG] Test runner hangs during regression run in v1.35
The test run stalls part way through, usually close to the end, and doesn't complete. We didn't previously have a globalTimeout value set...
Read more >
[BUG] Test execution gets stuck when running through ...
Context: Playwright Version: 1.30.0 Playwright Test for VSCode 1.0.6 ... [BUG] Test execution gets stuck when running through Playwright ...
Read more >
How to use Run method of Microsoft.Playwright.Program ...
Use the Run method in Microsoft.Playwright package in your next Playwright-dotnet project with LambdaTest Automation Testing Advisor.
Read more >
[Bug]: .NET Framework 4.7.2 $Driver not found: *** ...
Describe the bug Then i run playwright install,i got an exception "Microsoft. ... CreateAsync(); await using var browser = await playwright.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found