<h3 dir="auto">System info</h3>
<ul dir="auto">
<li>Playwright Version: [v1.30]</li>
<li>Operating System: [ Jenkins CI, Docker, Ubuntu 20]</li>
<li>Browser: [Chromium]</li>
<li>Other info:</li>
</ul>
<h3 dir="auto">Source code</h3>
<p dir="auto"><strong>Link to the GitHub repository with the repro</strong></p>
<p dir="auto"><a href="https://github.com/kLjubomir/playwright_reproducible">https://github.com/kLjubomir/playwright_reproducible</a></p>
<p dir="auto">Additional information on Jenkins and Dockerization:<br>
<strong>dockerfile content</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="#
# Dockerfile Description
#
FROM ubuntu

MAINTAINER Paul Brown

RUN apt-get update -y &amp;&amp; apt-get install -y \ 
    curl 
RUN curl -sL https://deb.nodesource.com/setup_18.x | bash -
RUN apt-get -y install nodejs
RUN npm install -g playwright "><pre class="notranslate"><code class="notranslate">#
# Dockerfile Description
#
FROM ubuntu

MAINTAINER Paul Brown

RUN apt-get update -y &amp;&amp; apt-get install -y \ 
    curl 
RUN curl -sL https://deb.nodesource.com/setup_18.x | bash -
RUN apt-get -y install nodejs
RUN npm install -g playwright 
</code></pre></div>
<p dir="auto"><strong>Playwright Setup - Jenkins</strong></p>
<p dir="auto">A Jenkinsfile is used, with this stage to run the tests inside a docker container and not the Jenkins host.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="stage('Running Tests') {
            agent {
                docker {
                    image “url to docker image”  (dockerfile to generate is attached)                                                        
                    registryUrl “docker registry url”
                    registryCredentialsId XXXXXXXXXXX
                    args &quot;-u root --shm-size=4gb -v $WORKSPACE/$tests_Dir:/tmp/tests&quot;
                    reuseNode true
                }
            }
            steps {
                script {
                    String testsDir = &quot;/tmp/tests&quot;
                    RunBrowserTests(friendlyAppName, Target_URL, Test_Specs_GLOB, NPM_Script, testsDir, &quot;&quot;, Target_Environment, Secret_Data_Path, Technology_Stack, &quot;&quot;, &quot;&quot;, Extra_Switches, &quot;&quot;, &quot;$WORKSPACE&quot;, CheckBooleanParam(Use_Script), Script_Config)
                }
            }
        }
"><pre class="notranslate"><code class="notranslate">stage('Running Tests') {
            agent {
                docker {
                    image “url to docker image”  (dockerfile to generate is attached)                                                        
                    registryUrl “docker registry url”
                    registryCredentialsId XXXXXXXXXXX
                    args "-u root --shm-size=4gb -v $WORKSPACE/$tests_Dir:/tmp/tests"
                    reuseNode true
                }
            }
            steps {
                script {
                    String testsDir = "/tmp/tests"
                    RunBrowserTests(friendlyAppName, Target_URL, Test_Specs_GLOB, NPM_Script, testsDir, "", Target_Environment, Secret_Data_Path, Technology_Stack, "", "", Extra_Switches, "", "$WORKSPACE", CheckBooleanParam(Use_Script), Script_Config)
                }
            }
        }

</code></pre></div>
<p dir="auto">RunBrowserTests does the following….</p>
<p dir="auto">Runs the bash script here : <a href="https://bitbucket.org/eurotaxglass1/av-automatron/src/master/runtests.sh" rel="nofollow">https://bitbucket.org/eurotaxglass1/av-automatron/src/master/runtests.sh</a><br>
E.g : bash /tmp/tests/runtests.sh staging Regression true true</p>
<p dir="auto"><strong>Steps</strong><br>
Run the tests over Jenkins repeatedly.</p>
<p dir="auto"><strong>Expected</strong><br>
Tests are initiated concurrently, one param "de" runs with a project and grep of "de" and the other param "uk" runs with project and grep "uk", each run produces its own report, one in the "DE" and one in the "UK" folder of the playwright-report folder.</p>
<p dir="auto"><strong>Actual</strong><br>
If running these tests on repeat, there will eventually within 10-20 runs be an error on Jenkins CI containing the Pirates dependency description, and when that occurs one of the concurrent runs will not execute or produce results, while the other concurrent run will. This happens with production code a lot more (every 2-4 runs) than with the boilerplate obscured code I have provided in the issue.</p>
<h3 dir="auto">System info</h3>
<ul dir="auto">
<li>Playwright Version: [v1.34.3]</li>
<li>Operating System: [Ubuntu 20]</li>
<li>Browser: [All]</li>
<li>Other info:</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>Link to the GitHub repository with the repro</strong></p>
<p dir="auto">[https://github.com/your_profile/playwright_issue_title]</p>
<p dir="auto">or</p>
<p dir="auto"><strong>Config file</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import dotenv from 'dotenv';

require('./sentry')

dotenv.config();

export default defineConfig({

    globalSetup: require.resolve('./global-setup'),

    testDir: './tests',
    timeout: 70000,
    forbidOnly: !!process.env.CI,
    retries: process.env.CI ? 2 : 0,
    workers: process.env.CI ? 2 : undefined,
    reporter: [['html', { open: 'never' }], ['list']],

    expect: {
        timeout: 20000,
    },

    use: {
        headless: !!process.env.NLAB_APP_TESTS_HEADLESS,
        actionTimeout: process.env.NLAB_APP_TESTS_ACTIONTIMEOUT ? +process.env.NLAB_APP_TESTS_ACTIONTIMEOUT : 5000,
        baseURL: process.env.NLAB_APP_TESTS_CONTOUR,
        ignoreHTTPSErrors: !!process.env.NLAB_APP_TESTS_IGNOREHTTPSERRORS,
        screenshot: process.env.NLAB_APP_TESTS_SCREENSHOT as 'only-on-failure' || 'only-on-failure',
        video: process.env.NLAB_APP_TESTS_VIDEO as 'retain-on-failure' || 'retain-on-failure',
        storageState: 'state.json',
        trace: process.env.NLAB_APP_TESTS_TRACE as TraceMode || 'retain-on-failure',
    },

    projects: [

        process.env.NLAB_APP_TESTS_BROWSER === 'webkit' ? {
            name: 'webkit',
            use: {
                ...devices['Desktop Safari'],

                viewport: { width: 1800, height: 900 },
            },
        } :

            process.env.NLAB_APP_TESTS_BROWSER === 'firefox' ? {
                name: 'firefox',
                use: {
                    ...devices['Desktop Firefox'],
                    viewport: { width: 1800, height: 900 },
                },
            } :

                {
                    name: 'chromium',
                    use: {
                        ...devices['Desktop Chrome'],
                        contextOptions: {
                            permissions: ['clipboard-read', 'clipboard-write'],
                        },
                        viewport: { width: 1800, height: 900 },
                    },
                },
    ],
});
[playwright-report.zip](https://github.com/microsoft/playwright/files/11601331/playwright-report.zip)
"><pre lang="import" class="notranslate"><code class="notranslate">import dotenv from 'dotenv';

require('./sentry')

dotenv.config();

export default defineConfig({

    globalSetup: require.resolve('./global-setup'),

    testDir: './tests',
    timeout: 70000,
    forbidOnly: !!process.env.CI,
    retries: process.env.CI ? 2 : 0,
    workers: process.env.CI ? 2 : undefined,
    reporter: [['html', { open: 'never' }], ['list']],

    expect: {
        timeout: 20000,
    },

    use: {
        headless: !!process.env.NLAB_APP_TESTS_HEADLESS,
        actionTimeout: process.env.NLAB_APP_TESTS_ACTIONTIMEOUT ? +process.env.NLAB_APP_TESTS_ACTIONTIMEOUT : 5000,
        baseURL: process.env.NLAB_APP_TESTS_CONTOUR,
        ignoreHTTPSErrors: !!process.env.NLAB_APP_TESTS_IGNOREHTTPSERRORS,
        screenshot: process.env.NLAB_APP_TESTS_SCREENSHOT as 'only-on-failure' || 'only-on-failure',
        video: process.env.NLAB_APP_TESTS_VIDEO as 'retain-on-failure' || 'retain-on-failure',
        storageState: 'state.json',
        trace: process.env.NLAB_APP_TESTS_TRACE as TraceMode || 'retain-on-failure',
    },

    projects: [

        process.env.NLAB_APP_TESTS_BROWSER === 'webkit' ? {
            name: 'webkit',
            use: {
                ...devices['Desktop Safari'],

                viewport: { width: 1800, height: 900 },
            },
        } :

            process.env.NLAB_APP_TESTS_BROWSER === 'firefox' ? {
                name: 'firefox',
                use: {
                    ...devices['Desktop Firefox'],
                    viewport: { width: 1800, height: 900 },
                },
            } :

                {
                    name: 'chromium',
                    use: {
                        ...devices['Desktop Chrome'],
                        contextOptions: {
                            permissions: ['clipboard-read', 'clipboard-write'],
                        },
                        viewport: { width: 1800, height: 900 },
                    },
                },
    ],
});
[playwright-report.zip](https://github.com/microsoft/playwright/files/11601331/playwright-report.zip)

</code></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="it('should check the box using setChecked', async ({ page }) =&gt; {
  await page.setContent(`&lt;input id='checkbox' type='checkbox'&gt;&lt;/input&gt;`);
  await page.getByRole('checkbox').check();
  await expect(page.getByRole('checkbox')).toBeChecked();
});"><pre class="notranslate"><span class="pl-en">it</span><span class="pl-kos">(</span><span class="pl-s">'should check the box using setChecked'</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">setContent</span><span class="pl-kos">(</span><span class="pl-s">`&lt;input id='checkbox' type='checkbox'&gt;&lt;/input&gt;`</span><span class="pl-kos">)</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">getByRole</span><span class="pl-kos">(</span><span class="pl-s">'checkbox'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">check</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</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-en">getByRole</span><span class="pl-kos">(</span><span class="pl-s">'checkbox'</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">toBeChecked</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>Steps</strong></p>
<ul dir="auto">
<li>[Run the test]</li>
<li>[...]</li>
</ul>
<p dir="auto"><strong>Expected</strong></p>
<p dir="auto">[Describe expected behavior]</p>
<p dir="auto"><strong>Actual</strong></p>
<p dir="auto">[Describe actual behavior]</p>