<p dir="auto"><strong>Context:</strong></p>
<ul dir="auto">
<li>Playwright Version: playwright-chromium@1.2.1</li>
<li>Operating System: Windows 10  Build 18363.900</li>
<li>Node.js version: 12.18.3</li>
<li>Browser: MS Edge Chromium Version 84.0.522.52 (Official build) (64-bit)</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 EDGE_PATH = require(&quot;edge-paths&quot;).getEdgePath();
const chromium = require('playwright-chromium').chromium;

const test = async () =&gt; {
	console.warn('Starting browser');
	const browser = await chromium.launch({
		executablePath: EDGE_PATH,
		headless: true,
		// logger: {
		// 	isEnabled: (name, severity) =&gt; {
		// 		return name === 'protocol';
		// 	},
		// 	log: (name, severity, message, args) =&gt; console.log(`${name} [${severity}] ${message}`)
		// }
	});

	const pageUrl = 'https://google.com';
	const closeBrowser = async timeout =&gt; {
		return new Promise(resolve =&gt; {
			setTimeout(async () =&gt; {
				console.log('Closing browser');
				await browser.close();
				resolve();
			}, timeout);
		});
	};

	const context = await browser.newContext();
	const page = await context.newPage();
	await page.goto(pageUrl);
	await closeBrowser(1000);
};

test();"><pre class="notranslate"><span class="pl-k">const</span> <span class="pl-c1">EDGE_PATH</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">"edge-paths"</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">getEdgePath</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">chromium</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'playwright-chromium'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">chromium</span><span class="pl-kos">;</span>

<span class="pl-k">const</span> <span class="pl-en">test</span> <span class="pl-c1">=</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-smi">console</span><span class="pl-kos">.</span><span class="pl-en">warn</span><span class="pl-kos">(</span><span class="pl-s">'Starting browser'</span><span class="pl-kos">)</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">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">executablePath</span>: <span class="pl-c1">EDGE_PATH</span><span class="pl-kos">,</span>
		<span class="pl-c1">headless</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span>
		<span class="pl-c">// logger: {</span>
		<span class="pl-c">// 	isEnabled: (name, severity) =&gt; {</span>
		<span class="pl-c">// 		return name === 'protocol';</span>
		<span class="pl-c">// 	},</span>
		<span class="pl-c">// 	log: (name, severity, message, args) =&gt; console.log(`${name} [${severity}] ${message}`)</span>
		<span class="pl-c">// }</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">pageUrl</span> <span class="pl-c1">=</span> <span class="pl-s">'https://google.com'</span><span class="pl-kos">;</span>
	<span class="pl-k">const</span> <span class="pl-en">closeBrowser</span> <span class="pl-c1">=</span> <span class="pl-k">async</span> <span class="pl-s1">timeout</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
		<span class="pl-k">return</span> <span class="pl-k">new</span> <span class="pl-v">Promise</span><span class="pl-kos">(</span><span class="pl-s1">resolve</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
			<span class="pl-en">setTimeout</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-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s">'Closing browser'</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-en">resolve</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-s1">timeout</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-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-s1">pageUrl</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
	<span class="pl-k">await</span> <span class="pl-en">closeBrowser</span><span class="pl-kos">(</span><span class="pl-c1">1000</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">test</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></p>
<p dir="auto">Hi!<br>
When I tried to use MS Edge Chromium for testing it crashes on browser closing.<br>
I provided simple script that reproduces my problem.</p>
<p dir="auto">After browser closing I have console error. This error is due to the "...\AppData\Local\Temp\playwright_chromiumdev_profile-8VPUjL\CrashpadMetrics-active.pma" can't be unlinked.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[Error: EPERM: operation not permitted, unlink '....\AppData\Local\Temp\playwright_chromiumdev_profile-8VPUjL\CrashpadMetrics-active.pma'] {
  errno: -4048,
  code: 'EPERM',
  syscall: 'unlink',
  path: '....\\AppData\\Local\\Temp\\playwright_chromiumdev_profile-8VPUjL\\CrashpadMetrics-active.pma'
}"><pre class="notranslate"><code class="notranslate">[Error: EPERM: operation not permitted, unlink '....\AppData\Local\Temp\playwright_chromiumdev_profile-8VPUjL\CrashpadMetrics-active.pma'] {
  errno: -4048,
  code: 'EPERM',
  syscall: 'unlink',
  path: '....\\AppData\\Local\\Temp\\playwright_chromiumdev_profile-8VPUjL\\CrashpadMetrics-active.pma'
}
</code></pre></div>
<p dir="auto">I suppose when playwright-chromium cleans temp folder MS Edge writes crash report there.<br>
The same error appears when browser running in headless mode inside Windows Docker container.<br>
Additionally I see system window with error. This window sais that MS Edge has stopped working.</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/69156424/89279960-ac05a400-d650-11ea-9fe2-df0098dfd0d9.png"><img src="https://user-images.githubusercontent.com/69156424/89279960-ac05a400-d650-11ea-9fe2-df0098dfd0d9.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">In case when browser is started with headless=false this problem is not reproduced.</p>
<p dir="auto">Other interesting thing: when logger with 'protocol' level is attached to the playwright, code often stops on the page.goto() command without any errors.</p>
<p dir="auto"><strong>Context:</strong></p>
<ul dir="auto">
<li>
<p dir="auto">Playwright Version: tested on versions 1.6.1, 1.3.0 and 1.4.0</p>
</li>
<li>
<p dir="auto">Operating System:<br>
Edition	Windows 10 Enterprise<br>
Version	20H2<br>
Installed on	‎8/‎20/‎2020<br>
OS build	19042.630<br>
Experience	Windows Feature Experience Pack 120.2212.31.0</p>
</li>
<li>
<p dir="auto">Node.js version: v12.10.0</p>
</li>
<li>
<p dir="auto">Browser: MS Edge Chromium Version 86.0.622.69</p>
</li>
<li>
<p dir="auto">Extra: Jest v. 23.6 on Visual Studio Code</p>
</li>
</ul>


<p dir="auto"><strong>Code Snippet</strong></p>
<p dir="auto">Help us help you! Put down a short code snippet that illustrates your bug and<br>
that we can run and debug locally. For example:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import { chromium } from &quot;playwright&quot;;

import { getEdgePath } from &quot;edge-paths&quot;;

jest.setTimeout(10000);
test(&quot;Basic Test&quot;, async () =&gt; {
    const browser = await chromium.launch({
        headless: false,
        executablePath: getEdgePath()
    });
    const context = await browser.newContext();
    const page = await context.newPage();
    await page.goto(&quot;https://www.google.com&quot;);
    await page.close();
    await context.close();
    await browser.close();
});"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-s1">chromium</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">"playwright"</span><span class="pl-kos">;</span>

<span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-s1">getEdgePath</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">"edge-paths"</span><span class="pl-kos">;</span>

<span class="pl-s1">jest</span><span class="pl-kos">.</span><span class="pl-en">setTimeout</span><span class="pl-kos">(</span><span class="pl-c1">10000</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">test</span><span class="pl-kos">(</span><span class="pl-s">"Basic Test"</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">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">executablePath</span>: <span class="pl-en">getEdgePath</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">"https://www.google.com"</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">close</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">context</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-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>
If you run this test it will pass but then you will see<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/54561656/99342064-ebdb4a80-283f-11eb-9b36-7e59aa001a67.png"><img src="https://user-images.githubusercontent.com/54561656/99342064-ebdb4a80-283f-11eb-9b36-7e59aa001a67.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">console.error node_modules/playwright/lib/server/helper.js:59<br>
[Error: EPERM: operation not permitted, unlink '[userpath]\AppData\Local\Temp\playwright_chromiumdev_profile-IAueWz\CrashpadMetrics-active.pma'] {<br>
errno: -4048,<br>
code: 'EPERM',<br>
syscall: 'unlink',<br>
path: '[userpath]\AppData\Local\Temp\playwright_chromiumdev_profile-IAueWz\CrashpadMetrics-active.pma'<br>
}<br>
This error won't occur if you run the test in head mode.</p>
<p dir="auto"><em>And if you open task manager you will see two msedge.exe processes that haven't ended</em> &lt;-- This issue is specific to Edge browser I believe</p>