diff --git a/core/modules/simpletest/simpletest.module b/core/modules/simpletest/simpletest.module
index 57b7f08..eb84548 100644
--- a/core/modules/simpletest/simpletest.module
+++ b/core/modules/simpletest/simpletest.module
@@ -179,7 +179,9 @@ function simpletest_run_tests($test_list) {
 function simpletest_run_phpunit_tests($test_id, array $unescaped_test_classnames) {
   $phpunit_file = simpletest_phpunit_xml_filepath($test_id);
   $ret = simpletest_phpunit_run_command($unescaped_test_classnames, $phpunit_file);
-  if ($ret) {
+  // A return value of 0 = passed test, 1 = failed test, > 1 indicates segfault
+  // timeout, or other type of failure.
+  if ($ret > 1) {
     // Something broke during the execution of phpunit.
     // Return an error record of all failed classes.
     $rows[] = [
diff --git a/core/modules/simpletest/tests/fixtures/simpletest_phpunit_run_command_test.php b/core/modules/simpletest/tests/fixtures/simpletest_phpunit_run_command_test.php
index bfed619..872753e 100644
--- a/core/modules/simpletest/tests/fixtures/simpletest_phpunit_run_command_test.php
+++ b/core/modules/simpletest/tests/fixtures/simpletest_phpunit_run_command_test.php
@@ -15,7 +15,7 @@ class SimpletestPhpunitRunCommandTestWillDie extends UnitTestCase {
 
   public function testWillDie() {
     if (getenv('SimpletestPhpunitRunCommandTestWillDie') === 'fail') {
-      exit(1);
+      exit(2);
     }
   }
 }
