Skip to content

[Bug]: Jobs running concurrently on the same machine download browsers to the same directory and clobber each other (Windows) #32179

@rjpowers10

Description

@rjpowers10

Version

1.44

Steps to reproduce

I'm using Azure DevOps Server with self-hosted agents (Windows). I am running many pipelines throughout the night and part of that is running Playwright tests (.NET and MSTest).

Each agent installs the browsers to an agent-specific directory using the PLAYWRIGHT_BROWSERS_PATH environment variable. This way each agent has its own copy of the browsers and everything is nicely isolated.

The issue is that while the browsers are eventually installed to PLAYWRIGHT_BROWSERS_PATH, they are downloaded to C:\Users\username\AppData\Local\Temp. While I have multiple agents, several of them are running on the same machine as the same user. This means that if agent 1 and agent 2 are running at roughly the same time, they will both try to download the browsers to the same location and will end up clobbering each other.

Expected behavior

The PLAYWRIGHT_BROWSERS_PATH keeps the browsers completely isolated, including the download.

Actual behavior

The agent will begin to download the browsers but it won't be long before you see this error.

[Error: ENOENT: no such file or directory, open 'C:\Users\[REDACTED]\AppData\Local\Temp\playwright-download-firefox-win64-1449.zip'] {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'open',
  path: 'C:\\Users\\[REDACTED]\\AppData\\Local\\Temp\\playwright-download-firefox-win64-1449.zip'
}

Additional context

No response

Environment

- Operating System: Windows Server 2022 21H2 (OS Build 20348.2655)
- Browser: All
- .NET Version (TFM): net8.0
- Other info: Azure DevOps Server 2022

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions