<h3 dir="auto">System info</h3>
<ul dir="auto">
<li>Playwright Version: 1.32.1</li>
<li>Operating System: macOS 12.6.3</li>
<li>Browser: All</li>
<li>Other info:</li>
</ul>
<h3 dir="auto">Source code</h3>
<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="  projects: [
    { name: 'setup', testMatch: /auth\.setup\.ts/ },
    {
      name: 'main tests',
      use: {
        ...devices['Chromium'],
        storageState: 'playwright/.auth/admin.json',
      },
      testDir: './tests', 
      dependencies: ['setup'],
    }]"><pre class="notranslate">  projects: <span class="pl-kos">[</span>
    <span class="pl-kos">{</span> <span class="pl-c1">name</span>: <span class="pl-s">'setup'</span><span class="pl-kos">,</span> <span class="pl-c1">testMatch</span>: <span class="pl-pds"><span class="pl-c1">/</span>auth<span class="pl-cce">\.</span>setup<span class="pl-cce">\.</span>ts<span class="pl-c1">/</span></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">'main tests'</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">'Chromium'</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
        <span class="pl-c1">storageState</span>: <span class="pl-s">'playwright/.auth/admin.json'</span><span class="pl-kos">,</span>
      <span class="pl-kos">}</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">dependencies</span>: <span class="pl-kos">[</span><span class="pl-s">'setup'</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"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/128826/228414148-d353f53c-5076-422f-a2d9-c912b5529d75.png"><img src="https://user-images.githubusercontent.com/128826/228414148-d353f53c-5076-422f-a2d9-c912b5529d75.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto"><strong>Steps</strong></p>
<ul dir="auto">
<li>tick "show browser" in VSCode</li>
<li>Run the test</li>
</ul>
<p dir="auto"><strong>Expected</strong></p>
<p dir="auto">Works as per show browser not set</p>
<p dir="auto"><strong>Actual</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="    Error: browserType.connect: WebSocket error: connect ECONNREFUSED 127.0.0.1:60054
    =========================== logs ===========================
    &lt;ws connecting&gt; ws://127.0.0.1:60054/e79324c018f1f82bb758d495bb34451a
    &lt;ws error&gt; ws://127.0.0.1:60054/e79324c018f1f82bb758d495bb34451a error connect ECONNREFUSED 127.0.0.1:60054
    &lt;ws connect error&gt; ws://127.0.0.1:60054/e79324c018f1f82bb758d495bb34451a connect ECONNREFUSED 127.0.0.1:60054
    &lt;ws disconnected&gt; ws://127.0.0.1:60054/e79324c018f1f82bb758d495bb34451a code=1006 reason=
    ============================================================"><pre class="notranslate"><code class="notranslate">    Error: browserType.connect: WebSocket error: connect ECONNREFUSED 127.0.0.1:60054
    =========================== logs ===========================
    &lt;ws connecting&gt; ws://127.0.0.1:60054/e79324c018f1f82bb758d495bb34451a
    &lt;ws error&gt; ws://127.0.0.1:60054/e79324c018f1f82bb758d495bb34451a error connect ECONNREFUSED 127.0.0.1:60054
    &lt;ws connect error&gt; ws://127.0.0.1:60054/e79324c018f1f82bb758d495bb34451a connect ECONNREFUSED 127.0.0.1:60054
    &lt;ws disconnected&gt; ws://127.0.0.1:60054/e79324c018f1f82bb758d495bb34451a code=1006 reason=
    ============================================================
</code></pre></div>
<h3 dir="auto">System info</h3>
<ul dir="auto">
<li>Playwright Version: [v1.35.1]</li>
<li>Test Env: MacOS 13.4.1, K8S</li>
<li>Browser: [Chromium]</li>
<li>Test Runner: Playwright test v1.45.1</li>
<li>Script language: Typescript</li>
</ul>
<h3 dir="auto">Source code</h3>




<p dir="auto"><strong>KubernetesPod.yaml</strong></p>
<div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="apiVersion: v1
kind: Pod
metadata:
  name: playwright
spec:
  imagePullSecrets:
    - name: vungleregistrykey
  containers:
    - name: playwright
      image: mcr.microsoft.com/playwright:v1.35.1-jammy
      imagePullPolicy: IfNotPresent
      resources:
        requests:
          memory: &quot;5Gi&quot;
          cpu: &quot;8&quot;
        limits:
          memory: &quot;10Gi&quot;
          cpu: &quot;12&quot;
      command:
        - cat
      tty: true
    - name: mongo
      image: mongo
      imagePullPolicy: IfNotPresent
      resources:
        requests:
          memory: &quot;128Mi&quot;
          cpu: &quot;250m&quot;
        limits:
          memory: &quot;256Mi&quot;
          cpu: &quot;500m&quot;
      command:
        - cat
      tty: true"><pre class="notranslate"><span class="pl-ent">apiVersion</span>: <span class="pl-c1">v1</span>
<span class="pl-ent">kind</span>: <span class="pl-s">Pod</span>
<span class="pl-ent">metadata</span>:
  <span class="pl-ent">name</span>: <span class="pl-s">playwright</span>
<span class="pl-ent">spec</span>:
  <span class="pl-ent">imagePullSecrets</span>:
    - <span class="pl-ent">name</span>: <span class="pl-s">vungleregistrykey</span>
  <span class="pl-ent">containers</span>:
    - <span class="pl-ent">name</span>: <span class="pl-s">playwright</span>
      <span class="pl-ent">image</span>: <span class="pl-s">mcr.microsoft.com/playwright:v1.35.1-jammy</span>
      <span class="pl-ent">imagePullPolicy</span>: <span class="pl-s">IfNotPresent</span>
      <span class="pl-ent">resources</span>:
        <span class="pl-ent">requests</span>:
          <span class="pl-ent">memory</span>: <span class="pl-s"><span class="pl-pds">"</span>5Gi<span class="pl-pds">"</span></span>
          <span class="pl-ent">cpu</span>: <span class="pl-s"><span class="pl-pds">"</span>8<span class="pl-pds">"</span></span>
        <span class="pl-ent">limits</span>:
          <span class="pl-ent">memory</span>: <span class="pl-s"><span class="pl-pds">"</span>10Gi<span class="pl-pds">"</span></span>
          <span class="pl-ent">cpu</span>: <span class="pl-s"><span class="pl-pds">"</span>12<span class="pl-pds">"</span></span>
      <span class="pl-ent">command</span>:
        - <span class="pl-s">cat</span>
      <span class="pl-ent">tty</span>: <span class="pl-c1">true</span>
    - <span class="pl-ent">name</span>: <span class="pl-s">mongo</span>
      <span class="pl-ent">image</span>: <span class="pl-s">mongo</span>
      <span class="pl-ent">imagePullPolicy</span>: <span class="pl-s">IfNotPresent</span>
      <span class="pl-ent">resources</span>:
        <span class="pl-ent">requests</span>:
          <span class="pl-ent">memory</span>: <span class="pl-s"><span class="pl-pds">"</span>128Mi<span class="pl-pds">"</span></span>
          <span class="pl-ent">cpu</span>: <span class="pl-s"><span class="pl-pds">"</span>250m<span class="pl-pds">"</span></span>
        <span class="pl-ent">limits</span>:
          <span class="pl-ent">memory</span>: <span class="pl-s"><span class="pl-pds">"</span>256Mi<span class="pl-pds">"</span></span>
          <span class="pl-ent">cpu</span>: <span class="pl-s"><span class="pl-pds">"</span>500m<span class="pl-pds">"</span></span>
      <span class="pl-ent">command</span>:
        - <span class="pl-s">cat</span>
      <span class="pl-ent">tty</span>: <span class="pl-c1">true</span></pre></div>
<p dir="auto"><strong>Jenkins Pipeline</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="......
        stage('Execute regression test on stage env') {
            when {expression {params.ENV == 'STAGE'}}
            steps {
                withCredentials([string(credentialsId: 'MongoDB_URL_SANITIZED_RW', variable: 'MONGODB_URL')]) {
                    echo 'Execute regression test on stage env...'
                    sh 'npx playwright test --workers=10'
                }
            }
        }
......"><pre class="notranslate"><code class="notranslate">......
        stage('Execute regression test on stage env') {
            when {expression {params.ENV == 'STAGE'}}
            steps {
                withCredentials([string(credentialsId: 'MongoDB_URL_SANITIZED_RW', variable: 'MONGODB_URL')]) {
                    echo 'Execute regression test on stage env...'
                    sh 'npx playwright test --workers=10'
                }
            }
        }
......
</code></pre></div>
<h3 dir="auto">Repro Steps:</h3>
<p dir="auto">In my test project, I have more than 170+ test cases running in fully parallel mode(worker processes: 10). However, when I upgrade the Playwright version from v1.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 process or stop the Jenkins job, this issue is reproducible on both of my laptop and on k8s env.</p>
<p dir="auto">If downgrade the playwright to v1.33.0, all test cases can be executed successfully to the end.</p>