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

test: run abort tests #14013

Closed
wants to merge 3 commits into from
Closed

test: run abort tests #14013

wants to merge 3 commits into from

Conversation

Trott
Copy link
Member

@Trott Trott commented Jun 30, 2017

Currently, tests in test/abort do not run in CI.

This change configures the test runner to not write core files, and run
the abort tests.

Fixes: #14012

This should land only after #13985 because that fixes a problem that causes one of the tests to fail. (In other words, had we been running these tests, that bug would have been caught!)

@addaleax @refack @nodejs/build @nodejs/testing

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

build test tools

@Trott Trott added build Issues and PRs related to build files or the CI. test Issues and PRs related to the tests. tools Issues and PRs related to the tools directory. labels Jun 30, 2017
@nodejs-github-bot nodejs-github-bot added build Issues and PRs related to build files or the CI. test Issues and PRs related to the tests. tools Issues and PRs related to the tools directory. windows Issues and PRs related to the Windows platform. labels Jun 30, 2017
@Trott
Copy link
Member Author

Trott commented Jun 30, 2017

@bnoordhuis

tools/test.py Outdated

from os.path import join, dirname, abspath, basename, isdir, exists
from datetime import datetime
from Queue import Queue, Empty

resource.setrlimit(resource.RLIMIT_CORE, (0,0))
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm thinking specialize SimpleTestConfiguration and do it there.
Maybe we'll want a test that examines the core-dump and deletes it?
Also there was an issue where we wanted the core for post-mortem...

Copy link
Member

Choose a reason for hiding this comment

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

Also there was an issue where we wanted the core for post-mortem...

Fwiw, we’d still need to configure the machines to actually store them in order to do that.

Copy link
Contributor

Choose a reason for hiding this comment

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

Found it: #13227
apparently the smartOS machines are configured

Copy link
Member

@bnoordhuis bnoordhuis Jun 30, 2017

Choose a reason for hiding this comment

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

I'm thinking specialize SimpleTestConfiguration and do it there.

I'd do it in test/abort/testcfg.py.

edit: hm, or not. It still affects multi-suite runs (tools/test.py abort addon) so it's not materially different from the current pull request.

Copy link
Contributor

@refack refack Jun 30, 2017

Choose a reason for hiding this comment

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

edit: hm, or not. It still affects multi-suite runs (tools/test.py abort addon) so it's not materially different from the current pull request.

Hmmm test.TestConfiguration doesn't have an end hook 😕

Edit: could put it last in the list in Makefile and vcbuild.bat

Copy link
Member

Choose a reason for hiding this comment

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

If you set both the hard and the soft limit (what this PR does), it's permanent; you can't change the limit back again in the same process.

Edit: could put it last in the list in Makefile and vcbuild.bat

Seems a little fragile. Better always X than sometimes X, sometimes Y, depending on how it's invoked.

Copy link
Contributor

@refack refack Jun 30, 2017

Choose a reason for hiding this comment

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

If you set both the hard and the soft limit (what this PR does), it's permanent; you can't change the limit back again in the same process.

Did not know that...

Seems a little fragile. Better always X than sometimes X, sometimes Y, depending on how it's invoked.

Ack.

So trying to be creative

  1. maybe change Makefile/vcbuild to run the about suite in a subsequent python invocation
  2. or make the new test.AbortTestConfiguration spawn a child process...

I want my cake and eat it too...

Copy link
Member Author

Choose a reason for hiding this comment

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

I took a few tentative steps towards using preexec_fn in the subprocess.Popen() call so that the resource limit only applies when needed, but my Python is not-so-good and I ran into not being sure how to get the necessary configuration indicators passed from the (will have to create it) AbortTestConfiguration.

https://stackoverflow.com/a/1689991/436641

Copy link
Member

Choose a reason for hiding this comment

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

I can take over if you want but what you have now is Good Enough, IMO. Threading through the ulimit setting from test/abort/testcfg.py to subprocess.Popen() is quite a bit of work for not all that much gain.

Copy link
Contributor

@refack refack Jul 2, 2017

Choose a reason for hiding this comment

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

@Trott tasked me with the digging... (since I was the nudnik who wanted this)

Copy link
Contributor

@cjihrig cjihrig left a comment

Choose a reason for hiding this comment

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

LGTM if it works :-)

@Trott Trott added the python PRs and issues that require attention from people who are familiar with Python. label Jul 24, 2017
@Trott Trott force-pushed the run-abort-tests branch 2 times, most recently from 807205a to 3dcff92 Compare August 24, 2017 21:05
@Trott
Copy link
Member Author

Trott commented Aug 24, 2017

@refack @addaleax @cjihrig @mhdawson @bnoordhuis I dug into the Python enough to make it so that it only disables core files for the tests in the abort directory. Please take a look.

@Trott Trott force-pushed the run-abort-tests branch 4 times, most recently from c654836 to ac48ed5 Compare August 24, 2017 21:08
@Trott
Copy link
Member Author

Trott commented Aug 24, 2017

@Trott
Copy link
Member Author

Trott commented Aug 25, 2017

Heh! Well, running the abort tests in CI seems like a good idea since there are failures on certain platforms. Will dig in...

@Trott Trott force-pushed the run-abort-tests branch 2 times, most recently from ea93f5d to b1fe802 Compare August 25, 2017 05:46
MylesBorins pushed a commit that referenced this pull request Sep 12, 2017
Currently, tests in test/abort do not run in CI.

This change configures the test runner to not write core files for abort
tests and to run them.

PR-URL: #14013
Fixes: #14012
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Yuta Hiroto <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
@refack
Copy link
Contributor

refack commented Sep 18, 2017

So I think smartOS does not respect resource.setrlimit(resource.RLIMIT_CORE, (0,0))
image
@misterdjules does this makes sense?

@Trott
Copy link
Member Author

Trott commented Sep 19, 2017

@refack If that's the case, I'd be OK with setting smartOS to skip all the abort tests via an abort.status file.

@gibfahn
Copy link
Member

gibfahn commented Sep 19, 2017

So I think smartOS does not respect resource.setrlimit(resource.RLIMIT_CORE, (0,0))

cc/ @nodejs/platform-smartos , I thought we purposefully set the smartos boxes to dump cores at some point, so maybe that setting is conflicting?

@misterdjules
Copy link

The reason why core files are created even when the RLIMIT_CORE limit is set to 0 for those processes is that the current setup of SmartOS instances enables "global" core dumps with:

 coreadm -g /home/iojs/cores/core.%f.%p -e global

When global core dumps are enabled, they are created for all processes, even those whose RLIMITE_CORE is set to 0.

I suggest we disable global core dumps, and enable only per-process core dumps with the following command:

coreadm -i /home/iojs/cores/core.%f.%p -e process -d global

@MylesBorins
Copy link
Contributor

Should this be backported to v6.x-staging? If yes please follow the guide and raise a backport PR, if no let me know or add the dont-land-on label.

@gibfahn
Copy link
Member

gibfahn commented Sep 22, 2017

@misterdjules is that something that should be done in the test runner or in an ansible script?

@gibfahn
Copy link
Member

gibfahn commented Sep 22, 2017

@misterdjules would you mind opening a PR in nodejs/build referencing this PR? I'm happy to review.

@misterdjules
Copy link

@gibfahn Sounds good, will do that.

misterdjules pushed a commit to misterdjules/build that referenced this pull request Sep 22, 2017
This allows for controlling core files limits per process (e.g per
tests).

Ref: nodejs/node#14013
@misterdjules
Copy link

@gibfahn See nodejs/build#894.

refack added a commit to refack/node that referenced this pull request Sep 23, 2017
PR-URL: nodejs#15056
Fixes: nodejs#14012
Refs: nodejs#14013
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
jasnell pushed a commit that referenced this pull request Sep 25, 2017
PR-URL: #15056
Fixes: #14012
Refs: #14013
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
gibfahn pushed a commit to nodejs/build that referenced this pull request Sep 29, 2017
This allows for controlling core files limits per process (e.g per
tests).

PR-URL: #894
Refs: nodejs/node#14013
@MylesBorins
Copy link
Contributor

safe to assume there is nothing else actionable here?

@Trott
Copy link
Member Author

Trott commented Oct 17, 2017

@MylesBorins First two commits should likely be cherry-picked over. They land cleanly right now.

Third commit, I'd say no. It doesn't land cleanly and it's not clear to me that running the abort tests on v6.x-staging adds much value at this point. (We had not been running the abort tests regularly for years.) As long as they run on master and v8.x-staging, I think we're good.

refack added a commit to refack/node that referenced this pull request Oct 24, 2017
PR-URL: nodejs#15056
Fixes: nodejs#14012
Refs: nodejs#14013
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
MylesBorins pushed a commit that referenced this pull request Oct 25, 2017
Backport-PR-URL: #16442
PR-URL: #15056
Fixes: #14012
Refs: #14013
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
MylesBorins pushed a commit that referenced this pull request Oct 25, 2017
Backport-PR-URL: #16442
PR-URL: #15056
Fixes: #14012
Refs: #14013
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
MylesBorins pushed a commit that referenced this pull request Oct 26, 2017
Backport-PR-URL: #16442
PR-URL: #15056
Fixes: #14012
Refs: #14013
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
@Trott Trott deleted the run-abort-tests branch January 13, 2022 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issues and PRs related to build files or the CI. python PRs and issues that require attention from people who are familiar with Python. test Issues and PRs related to the tests. tools Issues and PRs related to the tools directory. windows Issues and PRs related to the Windows platform.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

test: implement a way to regularly test abort behaviour on all platform