Page MenuHomePhabricator

Unable to run tests locally with HHVM
Closed, InvalidPublic

Description

php phpunit.php --configuration /www/dev.translatewiki.net/docroot/w/tests/phpunit/suite.xml includes/TitleTest.php 
PHPUnit already present
PHPUnit 3.7.37 by Sebastian Bergmann.

Configuration read from /www/dev.translatewiki.net/docroot/w/tests/phpunit/suite.xml

.ERROR 2: Attempted to serialize unserializable builtin class Closure$;883355216$ec4cf5dd2282dee5e19ff6119f958288$ in /www/dev.translatewiki.net/docroot/w/tests/phpunit/MediaWikiTestCase.php:358
ERROR 2: Destructor threw an object exception: exception 'MWException' with message 'TitleTest::tearDown() must call parent::tearDown()' in /www/dev.translatewiki.net/docroot/w/tests/phpunit/MediaWikiTestCase.php:95
Stack trace:
#0 (): MediaWikiTestCase->__destruct()
#1 {main} in :0
[Sat Dec 12 14:10:16 2015] [hphp] [8375:7f650b886c80:0:000001] [] Destructor threw an object exception: exception 'MWException' with message 'TitleTest::tearDown() must call parent::tearDown()' in /www/dev.translatewiki.net/docroot/w/tests/phpunit/MediaWikiTestCase.php:95
Stack trace:
#0 (): MediaWikiTestCase->__destruct()
#1 {main}

I have set: hhvm.enable_zend_compat = true per T95409#1191441.

This makes test development very difficult.

The first error is T71054.

Event Timeline

Nikerabbit raised the priority of this task from to Needs Triage.
Nikerabbit updated the task description. (Show Details)
Nikerabbit subscribed.
Nikerabbit claimed this task.

On further testing, the first error causes the second error.

And both errors were caused by my custom error handler:

set_error_handler(function($errno, $errStr, $errFile, $errLine)
{
	echo 'ERROR ' . $errno . ': ' . $errStr . ' in ' . $errFile . ':' . $errLine . "\r\n";
	ob_end_flush();
	exit;
});
set_exception_handler(function($exc)
{
	echo 'Unhandled Exception: ' . $exc . "\r\n";
	ob_flush();
});

I am going to limit it to web requests only.