test: fix domain with abort-on-uncaught on PPC
authorJulien Gilli <julien.gilli@joyent.com>
Wed, 14 Oct 2015 00:07:35 +0000 (17:07 -0700)
committerJames M Snell <jasnell@gmail.com>
Thu, 29 Oct 2015 15:38:43 +0000 (08:38 -0700)
Add SIGTRAP and the corresponding exit code to the list of signals/exit
codes that are expected when running tests that throw an uncaught error
and have --abort-on-uncaught-exception enabled.

Also refactor a bit related comments so that they better reflect what's
actually happening.

Fixes #3239.

PR: #3354
PR-URL: https://github.com/nodejs/node/pull/3354
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
test/parallel/test-domain-with-abort-on-uncaught-exception.js

index 9892ad6..bef952b 100644 (file)
@@ -135,20 +135,16 @@ if (process.argv[2] === 'child') {
             // --abort_on_uncaught_exception is passed on the command line,
             // the process must abort.
             //
-            // We use an array of values since the actual exit code can differ
-            // across compilers.
             // Depending on the compiler used, node will exit with either
-            // exit code 132 (SIGILL) or 134 (SIGABRT).
-            expectedExitCodes = [132, 134];
-
-            // On platforms using a non-GNU compiler, base::OS::Abort raises
-            // an illegal instruction signal.
-            // On platforms using a GNU compiler but with KSH being the
-            // default shell (like SmartOS), when a process aborts, KSH exits
-            // with an exit code that is greater than 256, and thus the exit
-            // code emitted with the 'exit' event is null and the signal is
-            // set to either SIGABRT or SIGILL.
-            expectedSignals = ['SIGABRT', 'SIGILL'];
+            // exit code 132 (SIGILL), 133 (SIGTRAP) or 134 (SIGABRT).
+            expectedExitCodes = [132, 133, 134];
+
+            // On platforms using KSH as the default shell (like SmartOS),
+            // when a process aborts, KSH exits with an exit code that is
+            // greater than 256, and thus the exit code emitted with the 'exit'
+            // event is null and the signal is set to either SIGILL, SIGTRAP,
+            // or SIGABRT (depending on the compiler).
+            expectedSignals = ['SIGILL', 'SIGTRAP', 'SIGABRT'];
 
             // On Windows, v8's base::OS::Abort triggers an access violation,
             // which corresponds to exit code 3221225477 (0xC0000005)