test: remove itest folders using rimraf (#26646)

This should fix:

Error: ENOTEMPTY: directory not empty, rmdir
'C:\Users\RUNNER~1\AppData\Local\Temp\pwt\workspaces\playwright-xyz-should-work-playwright-chromium-should-work-installation-tests\browsers\chromium-1076\chrome-win'
This commit is contained in:
Max Schmitt 2023-08-23 17:59:19 +02:00 committed by GitHub
parent 820611e3cc
commit d08b38013d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -26,6 +26,7 @@ import { Registry } from './registry';
import { spawnAsync } from './spawnAsync';
import type { CommonFixtures, CommonWorkerFixtures } from '../config/commonFixtures';
import { commonFixtures } from '../config/commonFixtures';
import { removeFolders } from '../../packages/playwright-core/lib/utils/fileUtils';
export const TMP_WORKSPACES = path.join(os.platform() === 'darwin' ? '/tmp' : os.tmpdir(), 'pwt', 'workspaces');
@ -103,7 +104,7 @@ export const test = _test
await use();
if (test.info().status === test.info().expectedStatus) {
// Browsers are large, we remove them after each test to save disk space.
await fs.promises.rm(_browsersPath, { recursive: true, force: true });
await removeFolders([_browsersPath]);
}
}, {
auto: true,