<p dir="auto"><strong>Context:</strong></p>
<ul dir="auto">
<li>Playwright Version: [1.10.0]</li>
<li>Operating System: [Windows]</li>
<li>Node.js version: [v15.14.0]</li>
<li>Browser: [Chromium]</li>
<li>Extra: [issue is not reproducible for firefox, webkit and headless chromium]</li>
</ul>
<p dir="auto">When I am just doing this</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import playwright from 'playwright';

(async () =&gt; {
    const browser = await playwright.chromium.launch({
        headless: false,
        timeout: 120000,
        logger: {
            isEnabled: (name, severity) =&gt; name === 'browser',
            log: (name, severity, message, args) =&gt; console.log(`${name} ${severity} ${message}`)
        }
    });
    const context = await browser.newContext();
    const page = await context.newPage();

    await page.goto('some url');

    await page.fill(&quot;//input[@name='email']&quot;, &quot;my username&quot;);
    await page.fill(&quot;//input[@name='password']&quot;, &quot;my password&quot;);
    await page.click(&quot;//button[@class='primary']&quot;);

    await page.waitForSelector(&quot;table.generic-table.findings-list-table&quot;)

    await page.screenshot({
        path: &quot;./screenshots/1.png&quot;,
        fullPage: true
    })

    console.log(&quot;here&quot;)
    await browser.close();
    console.log(&quot;after close&quot;)
})();"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">playwright</span> <span class="pl-k">from</span> <span class="pl-s">'playwright'</span><span class="pl-kos">;</span>

<span class="pl-kos">(</span><span class="pl-k">async</span> <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">const</span> <span class="pl-s1">browser</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">playwright</span><span class="pl-kos">.</span><span class="pl-c1">chromium</span><span class="pl-kos">.</span><span class="pl-en">launch</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
        <span class="pl-c1">headless</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span>
        <span class="pl-c1">timeout</span>: <span class="pl-c1">120000</span><span class="pl-kos">,</span>
        <span class="pl-c1">logger</span>: <span class="pl-kos">{</span>
            <span class="pl-en">isEnabled</span>: <span class="pl-kos">(</span><span class="pl-s1">name</span><span class="pl-kos">,</span> <span class="pl-s1">severity</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-s1">name</span> <span class="pl-c1">===</span> <span class="pl-s">'browser'</span><span class="pl-kos">,</span>
            <span class="pl-en">log</span>: <span class="pl-kos">(</span><span class="pl-s1">name</span><span class="pl-kos">,</span> <span class="pl-s1">severity</span><span class="pl-kos">,</span> <span class="pl-s1">message</span><span class="pl-kos">,</span> <span class="pl-s1">args</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</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-s">`<span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">name</span><span class="pl-kos">}</span></span> <span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">severity</span><span class="pl-kos">}</span></span> <span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">message</span><span class="pl-kos">}</span></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>
    <span class="pl-k">const</span> <span class="pl-s1">context</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">browser</span><span class="pl-kos">.</span><span class="pl-en">newContext</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-k">const</span> <span class="pl-s1">page</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">context</span><span class="pl-kos">.</span><span class="pl-en">newPage</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-s1">page</span><span class="pl-kos">.</span><span class="pl-en">goto</span><span class="pl-kos">(</span><span class="pl-s">'some url'</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">fill</span><span class="pl-kos">(</span><span class="pl-s">"//input[@name='email']"</span><span class="pl-kos">,</span> <span class="pl-s">"my username"</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">fill</span><span class="pl-kos">(</span><span class="pl-s">"//input[@name='password']"</span><span class="pl-kos">,</span> <span class="pl-s">"my password"</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">click</span><span class="pl-kos">(</span><span class="pl-s">"//button[@class='primary']"</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">waitForSelector</span><span class="pl-kos">(</span><span class="pl-s">"table.generic-table.findings-list-table"</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">screenshot</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
        <span class="pl-c1">path</span>: <span class="pl-s">"./screenshots/1.png"</span><span class="pl-kos">,</span>
        <span class="pl-c1">fullPage</span>: <span class="pl-c1">true</span>
    <span class="pl-kos">}</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-s">"here"</span><span class="pl-kos">)</span>
    <span class="pl-k">await</span> <span class="pl-s1">browser</span><span class="pl-kos">.</span><span class="pl-en">close</span><span class="pl-kos">(</span><span class="pl-kos">)</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-s">"after close"</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">I am running into this error that appears after a minute playwright tries to close the browser. It happens every time when browser command close starts and is not reproducible for firefox and webkit or headless chromium. GUI is closed but the node process is still running. Task manager shows chromium running and consuming 20-30 percent of cpu.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[Error: EPERM: operation not permitted, unlink 'C:\Users\AKREML~1\AppData\Local\Temp\playwright_chromiumdev_profile-dhO1Xy\CrashpadMetrics-active.pma'] {
  errno: -4048,
  code: 'EPERM',
  syscall: 'unlink',
  path: 'C:\\Users\\AKREML~1\\AppData\\Local\\Temp\\playwright_chromiumdev_profile-dhO1Xy\\CrashpadMetrics-active.pma'
}"><pre class="notranslate"><code class="notranslate">[Error: EPERM: operation not permitted, unlink 'C:\Users\AKREML~1\AppData\Local\Temp\playwright_chromiumdev_profile-dhO1Xy\CrashpadMetrics-active.pma'] {
  errno: -4048,
  code: 'EPERM',
  syscall: 'unlink',
  path: 'C:\\Users\\AKREML~1\\AppData\\Local\\Temp\\playwright_chromiumdev_profile-dhO1Xy\\CrashpadMetrics-active.pma'
}
</code></pre></div>
<p dir="auto">I can not share the url. Is there anything else I can share with you ?</p>
<p dir="auto"><strong>Context:</strong></p>
<ul dir="auto">
<li>Playwright Version: 1.8.0</li>
<li>Operating System: macOS 11.2</li>
<li>Node.js version: 12.18.4</li>
<li>Browser: Chrome (version 88.0.4324.146)</li>
<li>Extra: None</li>
</ul>
<p dir="auto"><strong>Code Snippet</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="const playwright = require('playwright')

(async () =&gt; {
  const browser = await playwright['chromium'].launch({
    executablePath:
      '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome',
    headless: false,
  })
  const context = await browser.newContext()
  const page = await context.newPage()
  await page.goto('https://google.com', { waitUntil: 'load' })
  const cookies = await page.context().cookies()
  await browser.close()
})()
"><pre class="notranslate"><span class="pl-k">const</span> <span class="pl-s1">playwright</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'playwright'</span><span class="pl-kos">)</span>

<span class="pl-kos">(</span><span class="pl-k">async</span> <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">const</span> <span class="pl-s1">browser</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">playwright</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-en">launch</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
    <span class="pl-c1">executablePath</span>:
      <span class="pl-s">'/Applications/Google Chrome.app/Contents/MacOS/Google Chrome'</span><span class="pl-kos">,</span>
    <span class="pl-c1">headless</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span>
  <span class="pl-kos">}</span><span class="pl-kos">)</span>
  <span class="pl-k">const</span> <span class="pl-s1">context</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">browser</span><span class="pl-kos">.</span><span class="pl-en">newContext</span><span class="pl-kos">(</span><span class="pl-kos">)</span>
  <span class="pl-k">const</span> <span class="pl-s1">page</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">context</span><span class="pl-kos">.</span><span class="pl-en">newPage</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">goto</span><span class="pl-kos">(</span><span class="pl-s">'https://google.com'</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-c1">waitUntil</span>: <span class="pl-s">'load'</span> <span class="pl-kos">}</span><span class="pl-kos">)</span>
  <span class="pl-k">const</span> <span class="pl-s1">cookies</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">page</span><span class="pl-kos">.</span><span class="pl-en">context</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">cookies</span><span class="pl-kos">(</span><span class="pl-kos">)</span>
  <span class="pl-k">await</span> <span class="pl-s1">browser</span><span class="pl-kos">.</span><span class="pl-en">close</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>Describe the bug</strong><br>
When running the test with no-headless Chrome (also happens with Chrome Dev, and Chrome Canary), the test is hung at <code class="notranslate">await browser.close()</code> and can not close the browser.</p>