fix(android): do not report all artifactsDirs as errors (#35530)
This commit is contained in:
parent
265e733752
commit
3b70f95b17
|
@ -323,7 +323,7 @@ export class AndroidDevice extends SdkObject {
|
|||
|
||||
const artifactsDir = await fs.promises.mkdtemp(ARTIFACTS_FOLDER);
|
||||
const cleanupArtifactsDir = async () => {
|
||||
const errors = await removeFolders([artifactsDir]);
|
||||
const errors = (await removeFolders([artifactsDir])).filter(Boolean);
|
||||
for (let i = 0; i < (errors || []).length; ++i)
|
||||
debug('pw:android')(`exception while removing ${artifactsDir}: ${errors[i]}`);
|
||||
};
|
||||
|
|
|
@ -29,7 +29,7 @@ export async function mkdirIfNeeded(filePath: string) {
|
|||
await fs.promises.mkdir(path.dirname(filePath), { recursive: true }).catch(() => {});
|
||||
}
|
||||
|
||||
export async function removeFolders(dirs: string[]): Promise<Error[]> {
|
||||
export async function removeFolders(dirs: string[]): Promise<(Error| undefined)[]> {
|
||||
return await Promise.all(dirs.map((dir: string) =>
|
||||
fs.promises.rm(dir, { recursive: true, force: true, maxRetries: 10 }).catch(e => e)
|
||||
));
|
||||
|
|
Loading…
Reference in New Issue