Prevent GC during phpunit shutdown
To keep phpunit from segfaulting during shutdown, turn off GC for php 5.3. Bug: 62623 Change-Id: Ie59780e37cbea027cc204a43df406667c3f432ab
This commit is contained in:
parent
a34555a39d
commit
90b3d62854
1 changed files with 11 additions and 0 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in a new issue