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

Using lb-mocha with VSCode's debug feature results in an error #1348

Closed
shimks opened this issue May 22, 2018 · 7 comments
Closed

Using lb-mocha with VSCode's debug feature results in an error #1348

shimks opened this issue May 22, 2018 · 7 comments
Labels
Internal Tooling Issues related to our tooling and monorepo infrastructore stale

Comments

@shimks
Copy link
Contributor

shimks commented May 22, 2018

Description / Steps to reproduce / Feature proposal

When using VSCode's debugging feature with LoopBack 4's testing script lb-mocha, it is not possible to use the restart button as doing so would result in timing out with an ECONNREFUSED error. I believe this is because the child processes (or the parent processes) aren't being correctly shut down when restarting.

There are two child processes involved when lb-mocha is invoked:
lb-mocha -> mocha (1st child process) -> _mocha (2nd child process)

Below is the settings I've tried to use with lb-mocha in launch.json

    {
      "type": "node",
      "request": "launch",
      "name": "Run Mocha tests",
      "program": "${workspaceRoot}/node_modules/.bin/lb-mocha",
      "cwd": "${workspaceRoot}",
      "args": [
        "DIST/test/**/*.js",
        "-t",
        "0",
        "--inspect"
      ],
      "autoAttachChildProcesses": true
    }

Ideally, we'd like to directly call _mocha so that we wouldn't have to deal with child processes, but that brings up the question of how we are going to handle testing the correct build for the node version the user is on.

This was brought up in #1336

See Reporting Issues for more tips on writing good issues

@shimks shimks added developer-experience Issues affecting ease of use and overall experience of LB users non-DP3 labels May 22, 2018
@dhmlau
Copy link
Member

dhmlau commented Aug 17, 2018

The PR #1509 has landed. Is this ticket good to close?

@shimks
Copy link
Contributor Author

shimks commented Aug 17, 2018

Nope, the issue here isn't coming from determining which dist directory to run the files from

@raymondfeng
Copy link
Contributor

@shimks Did you try to add --exit to args?

@shimks
Copy link
Contributor Author

shimks commented Aug 17, 2018

@raymondfeng Just tried it out. I get Cannot connect to runtime process, timeout after 10000 ms - (reason: Cannot connect to the target: connect ECONNREFUSED 127.0.0.1:9229). after I try to restart the debugging sesion

@dhmlau dhmlau removed the non-DP3 label Aug 23, 2018
@bajtos bajtos added Internal Tooling Issues related to our tooling and monorepo infrastructore and removed developer-experience Issues affecting ease of use and overall experience of LB users labels Jan 24, 2019
@kowsheek
Copy link

@shimks Hi there, have you been able to get this working since?

@stale
Copy link

stale bot commented May 10, 2020

This issue has been marked stale because it has not seen activity within six months. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS file at the top-level of this repository. This issue will be closed within 30 days of being stale.

@stale stale bot added the stale label May 10, 2020
@stale
Copy link

stale bot commented Jun 9, 2020

This issue has been closed due to continued inactivity. Thank you for your understanding. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS file at the top-level of this repository.

@stale stale bot closed this as completed Jun 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Internal Tooling Issues related to our tooling and monorepo infrastructore stale
Projects
None yet
Development

No branches or pull requests

5 participants