jestjs/jest

[Bug]: watch mode fails when git maintenance runs

Open

#13,869 opened on 2023年2月7日

GitHub で見る
 (27 comments) (5 reactions) (0 assignees)TypeScript (45,361 stars) (6,653 forks)batch import
:bug: BugHelp WantedPinnedWindows

説明

Version

29.4.0

Steps to reproduce

  1. Run your tests with jest --watch and wait until they finish.
  2. In another terminal, run git maintenance run.
  3. The watcher will fail

Expected behavior

Outside process shouldn't kill the watcher.

Actual behavior

Watcher dies immediately with

Error: EPERM: operation not permitted, lstat 'C:\Workspace\my-project\.git\objects\dc\a-very-long-hash'
Emitted 'error' event on NodeWatcher instance at:
    at C:\Workspace\my-project\node_modules\jest-haste-map\build\watchers\NodeWatcher.js:274:14
    at FSReqCallback.oncomplete (node:fs:207:21) {
  errno: -4048,
  code: 'EPERM',
  syscall: 'lstat',
  path: 'C:\\Workspace\\my-project\\.git\\objects\\dc\\a-very-long-hash'
}

I have also seen it point to .git\objects\maintenance.lock.

Additional context

This other issue is where I found the suggestion that it was a background git maintenance command that was causing the conflict, and once I knew that it was easy to reproduce.

Environment

System:
    OS: Windows 10 10.0.22621
    CPU: (12) x64 Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz
  Binaries:
    Node: 18.12.1 - ~\AppData\Local\fnm_multishells\30672_1675721836564\node.EXE
    npm: 8.19.2 - ~\AppData\Local\fnm_multishells\30672_1675721836564\npm.CMD
  npmPackages:
    jest: ^29.3.1 => 29.4.0

コントリビューターガイド

[Bug]: watch mode fails when git maintenance runs · jestjs/jest#13869 | Good First Issue