Skip to content

[🐛 Bug]: BrowserStack CLI support in browserstack service causes file contention error when running multiple jobs simultaneously #14943

@therealbrad

Description

@therealbrad

Have you read the Contributing Guidelines on issues?

WebdriverIO Version

v9.21.0

Node.js Version

v24.11.0

Mode

Standalone Mode

Which capabilities are you using?

What happened?

Since upgrading from v9.19.2, I can no longer run multiple jobs simultaneously. I get this error on subsequent jobs:

Execution of 364 workers started at 2025-12-16T00:04:50.802Z

node:events:497
      throw er; // Unhandled 'error' event
      ^

Error: ETXTBSY: text file is busy, open '/home/jenkins/.browserstack/cli/binary-linuxstatic-x64'
Emitted 'error' event on WriteStream instance at:
    at WriteStream.onerror (node:internal/streams/readable:1026:14)
    at WriteStream.emit (node:events:519:28)
    at WriteStream.emit (node:domain:488:12)
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  errno: -26,
  code: 'ETXTBSY',
  syscall: 'open',
  path: '/home/jenkins/.browserstack/cli/binary-linuxstatic-x64'
}

Before #14796 was introduced, I was able to run several jobs simultaneously.

What is your expected behavior?

I should be able to continue to run multiple jobs simultaneously since I am not explicitly using the browserstack CLI in my tests.

How to reproduce the bug.

  1. Execute a set of tests on browserstack using the browserstack service.
  2. In a separate thread, execute another set of tests using the browserstack service.

The second set of tests fails trying to use the same browserstack cli as the first set of tests.

Relevant log output

Execution of 364 workers started at 2025-12-16T00:04:50.802Z

node:events:497
      throw er; // Unhandled 'error' event
      ^

Error: ETXTBSY: text file is busy, open '/home/jenkins/.browserstack/cli/binary-linuxstatic-x64'
Emitted 'error' event on WriteStream instance at:
    at WriteStream.onerror (node:internal/streams/readable:1026:14)
    at WriteStream.emit (node:events:519:28)
    at WriteStream.emit (node:domain:488:12)
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  errno: -26,
  code: 'ETXTBSY',
  syscall: 'open',
  path: '/home/jenkins/.browserstack/cli/binary-linuxstatic-x64'
}

Code of Conduct

  • I agree to follow this project's Code of Conduct

Is there an existing issue for this?

  • I have searched the existing issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bug 🐛help wantedIssues that are free to take by anyone interested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions