From 90b3d6285481e5fab8fdbc0ad3a0415f82555df3 Mon Sep 17 00:00:00 2001 From: csteipp Date: Tue, 1 Apr 2014 17:28:55 -0700 Subject: [PATCH] Prevent GC during phpunit shutdown To keep phpunit from segfaulting during shutdown, turn off GC for php 5.3. Bug: 62623 Change-Id: Ie59780e37cbea027cc204a43df406667c3f432ab --- tests/phpunit/phpunit.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/phpunit/phpunit.php b/tests/phpunit/phpunit.php index 1aa2b4d15b..8e2bc0359d 100755 --- a/tests/phpunit/phpunit.php +++ b/tests/phpunit/phpunit.php @@ -114,4 +114,15 @@ if ( PHPUnit_Runner_Version::id() !== '@package_version@' if ( !class_exists( 'PHPUnit_TextUI_Command' ) ) { require_once 'PHPUnit/Autoload.php'; } + +// Prevent segfault when we have lots of unit tests (bug 62623) +if ( version_compare( PHP_VERSION, '5.4.0', '<' ) + && version_compare( PHP_VERSION, '5.3.0', '>=' ) +) { + register_shutdown_function( function() { + gc_collect_cycles(); + gc_disable(); + } ); +} + MediaWikiPHPUnitCommand::main(); -- 2.20.1