From: csteipp Date: Wed, 2 Apr 2014 00:28:55 +0000 (-0700) Subject: Prevent GC during phpunit shutdown X-Git-Tag: 1.31.0-rc.0~16216 X-Git-Url: http://git.cyclocoop.org/data/Luca_Pacioli_%28Gemaelde%29.jpeg?a=commitdiff_plain;h=90b3d6285481e5fab8fdbc0ad3a0415f82555df3;p=lhc%2Fweb%2Fwiklou.git Prevent GC during phpunit shutdown To keep phpunit from segfaulting during shutdown, turn off GC for php 5.3. Bug: 62623 Change-Id: Ie59780e37cbea027cc204a43df406667c3f432ab --- 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();