cli-testing-library: fireEvent.sigkill fails on some CI systems

While this code runs on all the same versions of Node on Windows within CI, it seems to error out on platforms like Windows.

Log:

https://github.com/crutchcorn/cli-testing-library/runs/4339953929?check_suite_focus=true

It appears to be a permissions issue of being unable to taskkill (or similar) a PID on Windows machines on GH Actions CI. This makes sense to me, as it may introduce vulnerabilities.

As a temporary workaround, I will be removing that test from CI and simply doing tests manually on Windows myself. Please let us know if there’s a better way you know of

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 23 (15 by maintainers)

Most upvoted comments

@Waldeedle thanks so much for contributing to this project and helping us out! Great work!

@crutchcorn just want to be clear, you are not seeing this issue for yourself locally? I was able to reproduce it on my local windows 11 desktop

Failing job in Plop https://github.com/plopjs/plop/actions/runs/7304409077/job/19906537229 windows-latest, Node.js 20.x

plop:test
  cache miss, executing b00a87c8e47ca0af
  
  > plop@4.0.1 test:instrument
  > nyc instrument ./bin ./instrumented/bin && nyc instrument ./src ./instrumented/src && cp package.json ./instrumented
  
  Browserslist: caniuse-lite is outdated. Please run:
    npx browserslist@latest --update-db
    Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating
  Browserslist: caniuse-lite is outdated. Please run:
    npx browserslist@latest --update-db
    Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating
  
  > plop@4.0.1 vitest
  > vitest run
  
  
   RUN  v1.1.0 D:/a/plop/plop/packages/plop
  
   ✓ tests/actions.spec.js  (6 tests | 4 skipped) 6435ms
   ✓ tests/wrapper.spec.js  (5 tests) 15245ms
   ✓ tests/esm.spec.js  (4 tests) 11460ms
   ✓ tests/action-failure.spec.js  (1 test) 3675ms
   ✓ tests/typescript.spec.js  (1 test) 2179ms
   ✓ tests/input-processing.spec.js  (16 tests | 1 skipped) 35128ms
  
  ⎯⎯⎯⎯⎯⎯ Unhandled Errors ⎯⎯⎯⎯⎯⎯
  
  Vitest caught 1 unhandled error during the test run.
  This might cause false positive tests. Resolve unhandled errors to make sure your tests are not affected.
  
  ⎯⎯⎯⎯ Unhandled Rejection ⎯⎯⎯⎯⎯
  Error: Command failed: taskkill /pid 1544 /T /F
  ERROR: The process with PID 5052 (child process of PID 1544) could not be terminated.
  Reason: The operation attempted is not supported.
  
  ERROR: The process with PID 1544 (child process of PID 5[72](https://github.com/plopjs/plop/actions/runs/7304409077/job/19906537229#step:5:74)8) could not be terminated.
  Reason: The operation attempted is not supported.
  
  
   ❯ ChildProcess.exithandler node:child_process:422:12
   ❯ ChildProcess.emit node:events:517:28
   ❯ maybeClose node:internal/child_process:1098:16
   ❯ Process.ChildProcess._handle.onexit node:internal/child_process:303:5
  
  ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
  Serialized Error: { code: 128, killed: false, signal: null, cmd: 'taskkill /pid 1544 /T /F' }
  This error originated in "tests/input-processing.spec.js" test file. It doesn't mean the error was thrown inside the file itself, but while it was running.
  The latest test that might've caused the error is "Should bypass input prompt with name". It might mean one of the following:
  - The error was thrown, while Vitest was running this test.
  - This was the last recorded test before the error was thrown, if error originated after test finished its execution.
  ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
  
   Test Files  6 passed (6)
        Tests  28 passed | 5 todo (33)
       Errors  1 error
     Start at  22:39:53
     Duration  36.38s (transform 179ms, setup 1.64s, collect 657ms, tests [74](https://github.com/plopjs/plop/actions/runs/7304409077/job/19906537229#step:5:76).12s, environment 2ms, prepare 1.[78](https://github.com/plopjs/plop/actions/runs/7304409077/job/19906537229#step:5:80)s)
  
  npm ERR! Lifecycle script `vitest` failed with error: 
  npm ERR! Error: command failed 
  npm ERR!   in workspace: plop@4.0.1 
  npm ERR!   at location: D:\a\plop\plop\packages\plop 
  Error:  command finished with error: command (D:\a\plop\plop\packages\plop) C:\Users\RUNNER~1\AppData\Local\Temp\xfs-42d[81](https://github.com/plopjs/plop/actions/runs/7304409077/job/19906537229#step:5:83)1ce\yarn.cmd run test exited (1)
Error: plop#test: command (D:\a\plop\plop\packages\plop) C:\Users\RUNNER~1\AppData\Local\Temp\xfs-42d811ce\yarn.cmd run test exited (1)

 Tasks:    1 successful, 2 total
Cached:    0 cached, 2 total
  Time:    54.193s 
Failed:    plop#test

 ERROR  run failed: command  exited (1)
Error: Process completed with exit code 1.