<h3 dir="auto">System info</h3>
<ul dir="auto">
<li>Playwright Version: [v1.32.3]</li>
<li>Operating System: [macOS 13.3.1]</li>
<li>Browser: [All]</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({
  baseURL: 'https://example.com/path', // 👈
  projects: [
    {
      name: 'chromium',
      use: { ...devices['Desktop Chrome'], },
    },
});"><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">baseURL</span>: <span class="pl-s">'https://example.com/path'</span><span class="pl-kos">,</span> <span class="pl-c">// 👈</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">'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-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="it('should check the box using setChecked', async ({ page, baseURL }) =&gt; {
  console.log(baseURL); // 👈  you'll see correct URL here
  await page.goto('test');
  await expect(page.url()).toBe('https://example.com/path/test'); // 👈 &quot;path&quot; part will be lost here
});"><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> baseURL <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
  <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s1">baseURL</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// 👈  you'll see correct URL here</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">'test'</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">url</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">toBe</span><span class="pl-kos">(</span><span class="pl-s">'https://example.com/path/test'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// 👈 "path" part will be lost here</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>
</ul>
<p dir="auto"><strong>Expected</strong></p>
<p dir="auto">The path should remain; otherwise, it's impossible to test sites deployed to some "prefix folder" without hardcoding that prefix.</p>
<p dir="auto"><strong>Actual</strong></p>
<p dir="auto">The "path" part is removed when the URL is created for navigation, like <code class="notranslate">page.goto()</code>.</p>
<h3 dir="auto">System info</h3>
<ul dir="auto">
<li>Playwright Version: [v1.32.1]</li>
<li>Operating System: [Windows 10]</li>
<li>Browser: [All, Chromium, Firefox, WebKit]</li>
<li>Other info:</li>
</ul>
<p dir="auto">I am running a NodeJs application inside a Docker container and within the application I launch a spawn process through an endpoint which can run all my playwright tests whenever I want in this way:</p>
<p dir="auto"><code class="notranslate">const pw_test = spawn('npx', ['playwright', 'test', `--config=tests_config_${date}.json`], { env: process.env , shell: true, detached: detach_child_process });</code></p>
<p dir="auto">The Docker image is built through a Jenkins Job and the Cointainer is launched/updated with Portainer.</p>
<p dir="auto">Everything went well for months but as the number of test grew, I thought to a way to speed up my test run. I solved by launching a Persistent Context which I can configure without any problems anymore (see this <a href="https://github.com/microsoft/playwright/issues/21750" data-hovercard-type="issue" data-hovercard-url="/microsoft/playwright/issues/21750/hovercard">issue</a> to have an idea of what I am talking about).</p>
<p dir="auto">What I am experiencing right now is that when I launch my Docker Container in my local machine the tests run and the browser Context close within seconds (or, really, few minutes..) without any problem. Instead, launching tests inside the Container in remote lead the test run to be reeeally slow in execution and the Browser Context takes too long to close. I even get these kind of messages in my reports:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/45291289/229560763-ec9b65b6-7537-4aff-97c5-6018b8d5beb9.png"><img src="https://user-images.githubusercontent.com/45291289/229560763-ec9b65b6-7537-4aff-97c5-6018b8d5beb9.png" alt="Immagine 2023-04-03 174528" style="max-width: 100%;"></a></p>
<p dir="auto">As you can see, I needed to increase the test timeout to 5 minutes but even with this "workaround" the problem still persists..<br>
I also want to add that I checked that during the Chromium instance running there weren't any plug-ins active.</p>
<p dir="auto"><strong>Steps</strong></p>
<ul dir="auto">
<li>[Navigate to the URL where my remote Node Application is running]</li>
<li>[Run the test through spawn process]</li>
<li>[Wait for the test to finish]</li>
</ul>
<p dir="auto"><strong>Expected</strong></p>
<p dir="auto">The test finish (can fail, success, break) within seconds or 1/2 minutes max (depending on how the test is big)</p>
<p dir="auto"><strong>Actual</strong></p>
<p dir="auto">The test remains stuck and the browser Context is too slow when closing, running out of time. Consequently, videos are not even recorded (but this is normal, is just to give another proof that the context is not normally close).</p>
<p dir="auto">Unfortunately I cannot provide any repro for this problem since there are different parts of program that are taking parts here..hope that you guys have any idea of how I can solve this problem..thank you!</p>