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

unit-tests: Switch stdio to non-blocking after invoking Node.js #9484

Merged

Conversation

stefwalter
Copy link
Contributor

Node leaves stdio file descriptors in non-blocking mode
when exiting. This has been reported, fixed, unfixed, ad nauseum.

nodejs/node#14752
nodejs/node#17737
nodejs/node#20592
nodejs/node#21257

Should this become a problem in more places, we could add such
a workaround elsewhere. But for now I'm limiting the ugliness to
the unit-tests container, where we see this cause a lot of failures.

@stefwalter stefwalter force-pushed the node-js-non-block-stdio branch from e290d79 to 1625a3e Compare June 23, 2018 17:32
Node leaves stdio file descriptors in non-blocking mode
when exiting. This has been reported, fixed, unfixed, ad nauseum.

nodejs/node#14752
nodejs/node#17737
nodejs/node#20592
nodejs/node#21257

Should this become a problem in more places, we could add such
a workaround elsewhere. But for now I'm limiting the ugliness to
the unit-tests container, where we see this cause a lot of failures.

Closes cockpit-project#9484
@stefwalter stefwalter force-pushed the node-js-non-block-stdio branch from 1625a3e to d920c1c Compare June 23, 2018 17:48
@stefwalter
Copy link
Contributor Author

Pushed a new set of containers.

Copy link
Member

@martinpitt martinpitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh, at least this is a more efficient hack than the careful cat :-) Supposedly the release container then needs something similar. Thanks!


assert "NODE_PATH" in os.environ
proc = subprocess.Popen([ os.environ["NODE_PATH"] ] + sys.argv[1:])
proc.wait()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine like that, just FYI: ret = subprocess.call([...])

@martinpitt martinpitt merged commit ef50d97 into cockpit-project:master Jun 24, 2018
@stefwalter stefwalter deleted the node-js-non-block-stdio branch July 2, 2018 05:39
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

Successfully merging this pull request may close these issues.

2 participants