summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorRich Trott <rtrott@gmail.com>2017-06-30 13:14:04 -0700
committerMyles Borins <mylesborins@google.com>2017-09-12 03:18:13 +0200
commitf89ef77144931e3c627400f34a42ad373c7d170f (patch)
tree9379705c9435d0133632c39f887db2a37a98afed /tools
parenta91a3fe6c46cd3bda73e7cb04399f4125dd844c6 (diff)
downloadnode-new-f89ef77144931e3c627400f34a42ad373c7d170f.tar.gz
test: run abort tests
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: https://github.com/nodejs/node/pull/14013 Fixes: https://github.com/nodejs/node/issues/14012 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/test.py18
1 files changed, 15 insertions, 3 deletions
diff --git a/tools/test.py b/tools/test.py
index 92ccb3df20..5a50c7f2e6 100755
--- a/tools/test.py
+++ b/tools/test.py
@@ -492,6 +492,7 @@ class TestCase(object):
self.arch = arch
self.mode = mode
self.parallel = False
+ self.disable_core_files = False
self.thread_id = 0
def IsNegative(self):
@@ -516,7 +517,8 @@ class TestCase(object):
output = Execute(full_command,
self.context,
self.context.GetTimeout(self.mode),
- env)
+ env,
+ disable_core_files = self.disable_core_files)
self.Cleanup()
return TestOutput(self,
full_command,
@@ -718,7 +720,7 @@ def CheckedUnlink(name):
PrintError("os.unlink() " + str(e))
break
-def Execute(args, context, timeout=None, env={}, faketty=False):
+def Execute(args, context, timeout=None, env={}, faketty=False, disable_core_files=False):
if faketty:
import pty
(out_master, fd_out) = pty.openpty()
@@ -740,6 +742,14 @@ def Execute(args, context, timeout=None, env={}, faketty=False):
for key, value in env.iteritems():
env_copy[key] = value
+ preexec_fn = None
+
+ if disable_core_files and not utils.IsWindows():
+ def disableCoreFiles():
+ import resource
+ resource.setrlimit(resource.RLIMIT_CORE, (0,0))
+ preexec_fn = disableCoreFiles
+
(process, exit_code, timed_out, output) = RunProcess(
context,
timeout,
@@ -749,7 +759,8 @@ def Execute(args, context, timeout=None, env={}, faketty=False):
stderr = fd_err,
env = env_copy,
faketty = faketty,
- pty_out = pty_out
+ pty_out = pty_out,
+ preexec_fn = preexec_fn
)
if faketty:
os.close(out_master)
@@ -1237,6 +1248,7 @@ class ClassifiedTest(object):
self.case = case
self.outcomes = outcomes
self.parallel = self.case.parallel
+ self.disable_core_files = self.case.disable_core_files
class Configuration(object):