Skip to content

[BUG] Error: EBUSY: resource busy or locked when using volumes in docker-compose with playwright 1.19.0 and mcr.microsoft.com/playwright:v1.15.0-focal #12106

@Fiona1Man

Description

@Fiona1Man

Context:

  • Playwright Version: 1.19.0
  • Operating System: Linux in Docker
  • Node.js version: v16.13.2
  • Browser: Chromium
  • Extra: using volumes in docker-compose
  • The issue was not there with versions:
    • 1.16.3 for playwright
    • mcr.microsoft.com/playwright:v1.10.0-focal

Code Snippet
Dockerfile:

FROM mcr.microsoft.com/playwright:v1.15.0-focal

RUN mkdir /app
WORKDIR /app

ENV PATH /app/node_modules/.bin:$PATH

COPY package.json package-lock.json /app/
RUN npm install && npx playwright install

COPY . /app/

in docker-compose.yml:

version: '3'

services:
  app:
    build: .
    command: 'bash'
    tty: true
    volumes:
      - /tmp/e2e-output:/tmp/e2e-output

in playwright.config.ts:

import { PlaywrightTestConfig } from '@playwright/test'

const config: PlaywrightTestConfig = {
  testDir: 'e2e',
  workers: 3,
  outputDir: '/tmp/e2e-output',
  use: {
    headless: false,
    screenshot: 'only-on-failure',
  },
  reporter: [['json'], ['list']],
}

export default config

in package.json:

...
"scripts": {
    "boot": "playwright install",
    "test": "dotenv-flow -- playwright test",
    "browser": "dotenv-flow -- playwright test --headed",
    "format": "eslint --cache --cache-strategy content --fix ."
  },
...

Describe the bug
After building the docker image and run with npm run test inside of docker container,
got this error:

Error: EBUSY: resource busy or locked, rmdir '/app/test-results'

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] test: `dotenv-flow -- playwright test "report"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] test script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2022-02-15T05_02_32_297Z-debug.log

and inside of log, there is nothing useful

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions