Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/playwright-core/src/server/browserContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ export abstract class BrowserContext<EM extends EventMap = EventMap> extends Sdk
}

private async _deleteAllTempDirs(): Promise<void> {
await Promise.all(this._tempDirs.map(async dir => await fs.promises.unlink(dir).catch(e => {})));
await Promise.all(this._tempDirs.map(async dir => await fs.promises.rm(dir, { recursive: true, force: true }).catch(e => {})));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here and in other places dealing with tmp, we want it to be a best effort. If a leaking process holding onto one of the files, we should give up and give it a pass.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. The current code uses force: true (ignores ENOENT) and .catch(e => {}) (swallows any remaining errors like EBUSY from held files). So it is already best-effort: it cleans up what it can and silently gives up on the rest.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, there are no retries, I missed that. All good then.

}

setCustomCloseHandler(handler: (() => Promise<any>) | undefined) {
Expand Down
Loading