Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bailing on failure when running concurrently should also work with vscode's WSL extension #1123

Closed
s-h-a-d-o-w opened this issue Mar 21, 2022 · 6 comments · Fixed by #1173
Closed

Comments

@s-h-a-d-o-w
Copy link
Contributor

s-h-a-d-o-w commented Mar 21, 2022

Description

This is related to my previous work in #1117.

Currently, this doesn't work because of an old flaw in vscode. It fails pretty gracefully though - it just can't interrupt other running tasks and prints the error caused by WSL. A lot like the previous behavior.

I've submitted an issue to the vscode team but... let's see whether they are interested in fixing this.

I would argue to hold on to hope for a week or two before considering other options (I do have some backup plans 😅), if that's alright with you.

Steps to reproduce

[STARTED] Reverting to original state because of errors...
[SUCCESS] Reverting to original state because of errors...
[STARTED] Cleaning up temporary files...
[SUCCESS] Cleaning up temporary files...

✖ eslint --cache:

/home/andy/temp/chrome-extension/src/auth.ts
  5:7  error  'something' is assigned a value but never used  @typescript-eslint/no-unused-vars

✖ 1 problem (1 error, 0 warnings)

(node:13531) UnhandledPromiseRejectionWarning: Error: your 131072x1 screen size is bogus. expect trouble

    at ChildProcess.<anonymous> (/home/andy/temp/chrome-extension/node_modules/lint-staged/node_modules/pidtree/lib/bin.js:42:19)
    at ChildProcess.emit (events.js:400:28)
    at maybeClose (internal/child_process.js:1058:16)
    at Socket.<anonymous> (internal/child_process.js:443:11)
    at Socket.emit (events.js:400:28)
    at Pipe.<anonymous> (net.js:686:12)
(Use `node --trace-warnings ...` to show where the warning was created)

Environment

  • OS: Windows 11 with Ubuntu WSL
  • Node.js: v14.19.0
  • lint-staged: 12.3.6
@juliomrc
Copy link

juliomrc commented Jun 8, 2022

After the latest minor update in pidtree, we could bump the required version of pidtree to ^0.6.0 in lint-staged to fix this issue.

@iiroj
Copy link
Member

iiroj commented Jun 8, 2022

@juliomrc thanks! Will be updated/fixed in #1173

@s-h-a-d-o-w
Copy link
Contributor Author

s-h-a-d-o-w commented Jun 8, 2022

@iiroj I would like to note that ever since I realized that my initial implementation was flawed (I'm deeply sorry about that!), I tried to improve it in ways that @lildeadprince mentioned here (using events instead of polling): #1138

I found a simpler, more reliable solution relatively quickly and you can see it here: https://github.com/s-h-a-d-o-w/lint-staged/blob/chore/improve-task-killing-reliability/lib/resolveTaskFn.js

I haven't been able to submit a PR though because as you can see on that branch, odd problems with some tests where multiple tests seem to share state appear. (In runAll.spec.js, things like: https://github.com/okonet/lint-staged/blob/master/test/runAll.spec.js#L195 )

But I thought I should share it here and now regardless, since the changes in resolveTaskFn.js seem solid to me, as the additional tests that I added also demonstrate.

@iiroj
Copy link
Member

iiroj commented Jun 8, 2022

@s-h-a-d-o-w thanks, I will take a look at the EventEmitter approach.

@iiroj
Copy link
Member

iiroj commented Jun 8, 2022

@s-h-a-d-o-w I added a commit to #1173 that replaces setInterval with EventsEmitter!

@s-h-a-d-o-w
Copy link
Contributor Author

Awesome, thanks for incorporating those improvements!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

3 participants