<h3 dir="auto">System info</h3>
<ul dir="auto">
<li>Playwright Version: [v1.35.1]</li>
<li>Operating System: [Linux, Mac]</li>
<li>Browser: [Chromium]</li>
<li>Other info: Random occurance</li>
</ul>
<h3 dir="auto">Source code</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I provided exact source code that allows reproducing the issue locally.</li>
</ul>




<p dir="auto">or</p>
<p dir="auto"><strong>Config file</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// playwright.config.ts
import { defineConfig, devices } from '@playwright/test';

import { testPlanFilter } from '../node_modules/allure-playwright/dist/testplan';

/**
 * Read environment variables from file.
 * https://github.com/motdotla/dotenv
 */
// require('dotenv').config();

/**
 * @see https://playwright.dev/docs/test-configuration
 */
export default defineConfig({
  /* Fail the build on CI if you accidentally left test.only in the source code. */
  forbidOnly: !!process.env.CI,

  /* Run tests in files in parallel */
  fullyParallel: true,
  grep: testPlanFilter(),

  /* Configure projects for major browsers */
  projects: [
    {
      name: 'Localhost',
      use: {
        baseURL: 'http://127.0.0.1:2001/',
      },
    },
    {
      name: 'Localhost Mobile',
      use: {
        ...devices['Pixel 5'],
        baseURL: 'http://127.0.0.1:2001/',
      },
    },
    {
      name: 'Production',
      use: {
        baseURL: 'https://',
      },
    },
  ],
  /* Reporter to use. See https://playwright.dev/docs/test-reporters */
  reporter: [
    ['html', { open: 'never' }],
    ['list'],
    [
      'allure-playwright',
      {
        detail: false,
        environmentInfo: {
          E2E_NODE_VERSION: process.version,
          E2E_OS: process.platform,
        },
      },
    ],
  ],

  /* Retry on CI only */
  retries: process.env.CI ? 1 : 0,

  testDir: './tests',

  timeout: 70000,

  /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
  use: {
    acceptDownloads: true,
    actionTimeout: 10000,
    navigationTimeout: 10000,

    screenshot: 'only-on-failure',
    /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
    trace: 'on-first-retry',
    video: 'retain-on-failure',
    viewport: { height: 800, width: 1440 },
  },

  /* Parallel tests on CI. */
  workers: process.env.CI ? 6 : 3,
});"><pre class="notranslate"><span class="pl-c">// playwright.config.ts</span>
<span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-s1">defineConfig</span><span class="pl-kos">,</span> <span class="pl-s1">devices</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'@playwright/test'</span><span class="pl-kos">;</span>

<span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-s1">testPlanFilter</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'../node_modules/allure-playwright/dist/testplan'</span><span class="pl-kos">;</span>

<span class="pl-c">/**</span>
<span class="pl-c"> * Read environment variables from file.</span>
<span class="pl-c"> * https://github.com/motdotla/dotenv</span>
<span class="pl-c"> */</span>
<span class="pl-c">// require('dotenv').config();</span>

<span class="pl-c">/**</span>
<span class="pl-c"> * <span class="pl-k">@see</span> https://playwright.dev/docs/test-configuration</span>
<span class="pl-c"> */</span>
<span class="pl-k">export</span> <span class="pl-k">default</span> <span class="pl-en">defineConfig</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
  <span class="pl-c">/* Fail the build on CI if you accidentally left test.only in the source code. */</span>
  <span class="pl-c1">forbidOnly</span>: <span class="pl-c1">!</span><span class="pl-c1">!</span><span class="pl-s1">process</span><span class="pl-kos">.</span><span class="pl-c1">env</span><span class="pl-kos">.</span><span class="pl-c1">CI</span><span class="pl-kos">,</span>

  <span class="pl-c">/* Run tests in files in parallel */</span>
  <span class="pl-c1">fullyParallel</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span>
  <span class="pl-c1">grep</span>: <span class="pl-en">testPlanFilter</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">,</span>

  <span class="pl-c">/* Configure projects for major browsers */</span>
  <span class="pl-c1">projects</span>: <span class="pl-kos">[</span>
    <span class="pl-kos">{</span>
      <span class="pl-c1">name</span>: <span class="pl-s">'Localhost'</span><span class="pl-kos">,</span>
      <span class="pl-c1">use</span>: <span class="pl-kos">{</span>
        <span class="pl-c1">baseURL</span>: <span class="pl-s">'http://127.0.0.1:2001/'</span><span class="pl-kos">,</span>
      <span class="pl-kos">}</span><span class="pl-kos">,</span>
    <span class="pl-kos">}</span><span class="pl-kos">,</span>
    <span class="pl-kos">{</span>
      <span class="pl-c1">name</span>: <span class="pl-s">'Localhost Mobile'</span><span class="pl-kos">,</span>
      <span class="pl-c1">use</span>: <span class="pl-kos">{</span>
        ...<span class="pl-s1">devices</span><span class="pl-kos">[</span><span class="pl-s">'Pixel 5'</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
        <span class="pl-c1">baseURL</span>: <span class="pl-s">'http://127.0.0.1:2001/'</span><span class="pl-kos">,</span>
      <span class="pl-kos">}</span><span class="pl-kos">,</span>
    <span class="pl-kos">}</span><span class="pl-kos">,</span>
    <span class="pl-kos">{</span>
      <span class="pl-c1">name</span>: <span class="pl-s">'Production'</span><span class="pl-kos">,</span>
      <span class="pl-c1">use</span>: <span class="pl-kos">{</span>
        <span class="pl-c1">baseURL</span>: <span class="pl-s">'https://'</span><span class="pl-kos">,</span>
      <span class="pl-kos">}</span><span class="pl-kos">,</span>
    <span class="pl-kos">}</span><span class="pl-kos">,</span>
  <span class="pl-kos">]</span><span class="pl-kos">,</span>
  <span class="pl-c">/* Reporter to use. See https://playwright.dev/docs/test-reporters */</span>
  <span class="pl-c1">reporter</span>: <span class="pl-kos">[</span>
    <span class="pl-kos">[</span><span class="pl-s">'html'</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-c1">open</span>: <span class="pl-s">'never'</span> <span class="pl-kos">}</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
    <span class="pl-kos">[</span><span class="pl-s">'list'</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
    <span class="pl-kos">[</span>
      <span class="pl-s">'allure-playwright'</span><span class="pl-kos">,</span>
      <span class="pl-kos">{</span>
        <span class="pl-c1">detail</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span>
        <span class="pl-c1">environmentInfo</span>: <span class="pl-kos">{</span>
          <span class="pl-c1">E2E_NODE_VERSION</span>: <span class="pl-s1">process</span><span class="pl-kos">.</span><span class="pl-c1">version</span><span class="pl-kos">,</span>
          <span class="pl-c1">E2E_OS</span>: <span class="pl-s1">process</span><span class="pl-kos">.</span><span class="pl-c1">platform</span><span class="pl-kos">,</span>
        <span class="pl-kos">}</span><span class="pl-kos">,</span>
      <span class="pl-kos">}</span><span class="pl-kos">,</span>
    <span class="pl-kos">]</span><span class="pl-kos">,</span>
  <span class="pl-kos">]</span><span class="pl-kos">,</span>

  <span class="pl-c">/* Retry on CI only */</span>
  <span class="pl-c1">retries</span>: <span class="pl-s1">process</span><span class="pl-kos">.</span><span class="pl-c1">env</span><span class="pl-kos">.</span><span class="pl-c1">CI</span> ? <span class="pl-c1">1</span> : <span class="pl-c1">0</span><span class="pl-kos">,</span>

  <span class="pl-c1">testDir</span>: <span class="pl-s">'./tests'</span><span class="pl-kos">,</span>

  <span class="pl-c1">timeout</span>: <span class="pl-c1">70000</span><span class="pl-kos">,</span>

  <span class="pl-c">/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */</span>
  <span class="pl-c1">use</span>: <span class="pl-kos">{</span>
    <span class="pl-c1">acceptDownloads</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span>
    <span class="pl-c1">actionTimeout</span>: <span class="pl-c1">10000</span><span class="pl-kos">,</span>
    <span class="pl-c1">navigationTimeout</span>: <span class="pl-c1">10000</span><span class="pl-kos">,</span>

    <span class="pl-c1">screenshot</span>: <span class="pl-s">'only-on-failure'</span><span class="pl-kos">,</span>
    <span class="pl-c">/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */</span>
    <span class="pl-c1">trace</span>: <span class="pl-s">'on-first-retry'</span><span class="pl-kos">,</span>
    <span class="pl-c1">video</span>: <span class="pl-s">'retain-on-failure'</span><span class="pl-kos">,</span>
    <span class="pl-c1">viewport</span>: <span class="pl-kos">{</span> <span class="pl-c1">height</span>: <span class="pl-c1">800</span><span class="pl-kos">,</span> <span class="pl-c1">width</span>: <span class="pl-c1">1440</span> <span class="pl-kos">}</span><span class="pl-kos">,</span>
  <span class="pl-kos">}</span><span class="pl-kos">,</span>

  <span class="pl-c">/* Parallel tests on CI. */</span>
  <span class="pl-c1">workers</span>: <span class="pl-s1">process</span><span class="pl-kos">.</span><span class="pl-c1">env</span><span class="pl-kos">.</span><span class="pl-c1">CI</span> ? <span class="pl-c1">6</span> : <span class="pl-c1">3</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><strong>Test file (self-contained)</strong><br>
Reproducible with random tests. The only required conditions are: parallel execution and at least 1 retry</p>
<p dir="auto"><strong>Steps</strong></p>
<ul dir="auto">
<li>Run the test in parallel</li>
<li>Some of the tests should be retried</li>
</ul>
<p dir="auto"><strong>Expected</strong><br>
Execution should stop by itself</p>
<p dir="auto"><strong>Actual</strong><br>
The teardown process hangs and gets killed by timeout for some tests, but workers never stop.</p>
<p dir="auto">Also I can see the next artifacts:</p>
<ul dir="auto">
<li>In CI I'm getting an error about a non-existent screenshot file:<br>
<a target="_blank" rel="noopener noreferrer" href="https://user-images.githubusercontent.com/1978717/252706436-1531cd7f-4dd7-47b7-b5c1-7d951d24d114.png"><img src="https://user-images.githubusercontent.com/1978717/252706436-1531cd7f-4dd7-47b7-b5c1-7d951d24d114.png" alt="CleanShot 2023-07-11 at 17 59 53" style="max-width: 100%;"></a></li>
<li>Locally, it just hangs without any issues. But even though the passed test, in this case, is treated as Broken and screenshot+video attached.<br>
<a target="_blank" rel="noopener noreferrer" href="https://user-images.githubusercontent.com/1978717/252707886-1df54721-c059-4ace-bbb8-156b7af6db2e.png"><img src="https://user-images.githubusercontent.com/1978717/252707886-1df54721-c059-4ace-bbb8-156b7af6db2e.png" alt="CleanShot 2023-07-11 at 18 05 48" style="max-width: 100%;"></a></li>
</ul>
<h3 dir="auto">System info</h3>
<ul dir="auto">
<li>Playwright Version: [v1.32.2]</li>
<li>Operating System: [Ubuntu 20.04]</li>
<li>Browser: [All, Chromium, Firefox, WebKit]</li>
<li>Other info:
<ul dir="auto">
<li>Github Codespace image: mcr.microsoft.com/devcontainers/universal:latest</li>
</ul>
</li>
</ul>
<h3 dir="auto">Source code</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I provided exact source code that allows reproducing the issue locally.</li>
</ul>




<p dir="auto"><strong>Config file</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// playwright.config.ts
import { defineConfig, devices } from '@playwright/test';

export default defineConfig({
  projects: [
    {
      name: 'edge',
      use: { ...devices['Desktop Edge']},
    },
    {
      name: 'chromium',
      use: { ...devices['Desktop Chrome']},
    },
    {
      name: 'webkit',
      use: { ...devices['Desktop Safari'] },
    },
    {
      name: 'firefox',
      use: { ...devices['Desktop Firefox'] },
    }
  ]
});"><pre class="notranslate"><span class="pl-c">// playwright.config.ts</span>
<span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-s1">defineConfig</span><span class="pl-kos">,</span> <span class="pl-s1">devices</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'@playwright/test'</span><span class="pl-kos">;</span>

<span class="pl-k">export</span> <span class="pl-k">default</span> <span class="pl-en">defineConfig</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
  <span class="pl-c1">projects</span>: <span class="pl-kos">[</span>
    <span class="pl-kos">{</span>
      <span class="pl-c1">name</span>: <span class="pl-s">'edge'</span><span class="pl-kos">,</span>
      <span class="pl-c1">use</span>: <span class="pl-kos">{</span> ...<span class="pl-s1">devices</span><span class="pl-kos">[</span><span class="pl-s">'Desktop Edge'</span><span class="pl-kos">]</span><span class="pl-kos">}</span><span class="pl-kos">,</span>
    <span class="pl-kos">}</span><span class="pl-kos">,</span>
    <span class="pl-kos">{</span>
      <span class="pl-c1">name</span>: <span class="pl-s">'chromium'</span><span class="pl-kos">,</span>
      <span class="pl-c1">use</span>: <span class="pl-kos">{</span> ...<span class="pl-s1">devices</span><span class="pl-kos">[</span><span class="pl-s">'Desktop Chrome'</span><span class="pl-kos">]</span><span class="pl-kos">}</span><span class="pl-kos">,</span>
    <span class="pl-kos">}</span><span class="pl-kos">,</span>
    <span class="pl-kos">{</span>
      <span class="pl-c1">name</span>: <span class="pl-s">'webkit'</span><span class="pl-kos">,</span>
      <span class="pl-c1">use</span>: <span class="pl-kos">{</span> ...<span class="pl-s1">devices</span><span class="pl-kos">[</span><span class="pl-s">'Desktop Safari'</span><span class="pl-kos">]</span> <span class="pl-kos">}</span><span class="pl-kos">,</span>
    <span class="pl-kos">}</span><span class="pl-kos">,</span>
    <span class="pl-kos">{</span>
      <span class="pl-c1">name</span>: <span class="pl-s">'firefox'</span><span class="pl-kos">,</span>
      <span class="pl-c1">use</span>: <span class="pl-kos">{</span> ...<span class="pl-s1">devices</span><span class="pl-kos">[</span><span class="pl-s">'Desktop Firefox'</span><span class="pl-kos">]</span> <span class="pl-kos">}</span><span class="pl-kos">,</span>
    <span class="pl-kos">}</span>
  <span class="pl-kos">]</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><strong>Test file (self-contained)</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import { test, expect } from '@playwright/test';

test('has title', async ({ page }) =&gt; {
  await page.goto('https://playwright.dev/');

  // Expect a title &quot;to contain&quot; a substring.
  await expect(page).toHaveTitle(/Playwright/);
});"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-s1">test</span><span class="pl-kos">,</span> <span class="pl-s1">expect</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'@playwright/test'</span><span class="pl-kos">;</span>

<span class="pl-en">test</span><span class="pl-kos">(</span><span class="pl-s">'has title'</span><span class="pl-kos">,</span> <span class="pl-k">async</span> <span class="pl-kos">(</span><span class="pl-kos">{</span> page <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
  <span class="pl-k">await</span> <span class="pl-s1">page</span><span class="pl-kos">.</span><span class="pl-en">goto</span><span class="pl-kos">(</span><span class="pl-s">'https://playwright.dev/'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

  <span class="pl-c">// Expect a title "to contain" a substring.</span>
  <span class="pl-k">await</span> <span class="pl-en">expect</span><span class="pl-kos">(</span><span class="pl-s1">page</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">toHaveTitle</span><span class="pl-kos">(</span><span class="pl-pds"><span class="pl-c1">/</span>Playwright<span class="pl-c1">/</span></span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><strong>Steps</strong></p>
<ul dir="auto">
<li>Run <code class="notranslate">npm init playwright@latest</code></li>
<li>Run <code class="notranslate">xvfb-run npx playwright test --debug</code></li>
</ul>
<p dir="auto"><strong>Expected</strong><br>
Each browser should open and allow for debugging</p>
<p dir="auto"><strong>Actual</strong><br>
The first test never finishes. See below for log:<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/65235172/230488139-b931d192-8728-4ac6-8695-cd88e49fc79c.png"><img src="https://user-images.githubusercontent.com/65235172/230488139-b931d192-8728-4ac6-8695-cd88e49fc79c.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">I have been scouring the internet for a while now trying to find a solution to this. A couple points from what I have found and tried:</p>
<ul dir="auto">
<li>I know that I am using the "mcr.microsoft.com/devcontainers/universal:latest" image and not playwright's official docker image, but my understanding is that this should still work with what I have.</li>
<li>I have tried the <code class="notranslate">--disable-gpu</code> launch flag and that did not work</li>
<li>I have tried manually installing the browser binaries using <code class="notranslate">PLAYWRIGHT_BROWSERS_PATH=$HOME/pw-browsers</code> and <code class="notranslate">PLAYWRIGHT_BROWSERS_PATH=0</code>. Neither option worked.</li>
</ul>
<p dir="auto">Finally, thank you very much for your time as I know there are a lot of issues that come into this repo!<g-emoji class="g-emoji" alias="smile" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f604.png">😄</g-emoji></p>