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

Started processes on preBuild are not stopped #119

Open
spamsch opened this issue Feb 9, 2021 · 2 comments
Open

Started processes on preBuild are not stopped #119

spamsch opened this issue Feb 9, 2021 · 2 comments

Comments

@spamsch
Copy link

spamsch commented Feb 9, 2021

Versions

  • What is this plugin's version? 1.9.1
  • What is Cypress version? 6.4.0
  • What Netlify build image are you using? Ubuntu Xenial 16.04
  • What is the Node version if you know it? 12.18.0

Describe the bug
Process are not stopped

Logs and screenshots

When using the following configuration the processes are not stopped

[[plugins]]
  package = "netlify-plugin-cypress"

  [plugins.inputs]
    skip = true

  [plugins.inputs.preBuild]
    start = 'npx netlify dev'
    wait-on = 'http://localhost:8888'

  [plugins.inputs.onSuccess]
    record = true

then processes are not stopped

9:57:40 PM: (netlify-plugin-cypress onSuccess completed in 4ms)
9:57:40 PM: 
9:57:40 PM: ** WARNING **
9:57:40 PM: There are some lingering processes even after the build process finished:
9:57:40 PM: 
9:57:40 PM: USER         PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
9:57:40 PM: buildbot    1867  4.8  0.5 24044868 164688 ?     Sl   20:55   0:07 node /opt/buildhome/.nvm/versions/node/v12.18.0/bin/npx netlify dev
9:57:40 PM: buildbot    1880  0.3  0.1 739708 40260 ?        Sl   20:55   0:00 npm
9:57:40 PM: buildbot    1891  0.0  0.0   4512   716 ?        S    20:55   0:00 sh -c vue-cli-service serve
9:57:40 PM: buildbot    1892 29.4  1.4 1243992 451500 ?      Sl   20:55   0:44 node /opt/build/repo/node_modules/.bin/vue-cli-service serve
9:57:40 PM: 
9:57:40 PM: Our builds do not kill your processes automatically, so please make sure
9:57:40 PM: that nothing is running after your build finishes, or it will be marked as
9:57:40 PM: failed since something is still running.
@bahmutov
Copy link
Contributor

bahmutov commented Mar 8, 2021

We are using utils.run https://github.com/netlify/build/blob/master/packages/run-utils/README.md to execute the server command.

@bahmutov
Copy link
Contributor

bahmutov commented Mar 8, 2021

I tried it out in cypress-io/netlify-plugin-prebuild-example#54

Advice: instead of using npm run develop command in netlify.toml file, try running the original command. For example

when using npm run develop command the NPM process remains + Gatsby

image

But if we use the direct command, execa can find it and use it

[plugins.inputs.preBuild]
  enable = true
  start = 'gatsby develop'

and only the single deep process remains

image

Of course, it would be nice to resolve it and kill the entire tree of processes. I will look into this in the future, opened a question for Netlify team netlify/build#2371

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

No branches or pull requests

2 participants