CircleCI中的代码测试错误:PHP致命错误:允许的内存大小

时间:2015-08-08 04:35:11

标签: php phpunit yii2 codeception circleci

我有问题。我在CircleCI中运行自动测试,但测试结果失败了。然后我用SSH调试。当我在终端中运行相同的测试命令时,结果是成功的。

命令:

$ cd tests; codecept run && cd - || exit 1 returned exit code 1

自动测试结果:

Time: 9.93 seconds, Memory: 32.75Mb

OK (24 tests, 52 assertions)
PHP Warning:  Uncaught exception 'PHPUnit_Framework_Exception' with message 'var_export does not handle circular references' in /home/ubuntu/.composer/vendor/codeception/codeception/src/Codeception/Subscriber/ErrorHandler.php:49
Stack trace:
#0 [internal function]: Codeception\Subscriber\ErrorHandler->errorHandler(2, 'var_export does...', '/home/ubuntu/id...', 187, Array)
#1 /home/ubuntu/idarex/vendor/yiisoft/yii2/helpers/BaseVarDumper.php(187): var_export(Object(Pheanstalk\Exception\ConnectionException), true)
#2 /home/ubuntu/idarex/vendor/yiisoft/yii2/helpers/BaseVarDumper.php(147): yii\helpers\BaseVarDumper::exportInternal(Object(Pheanstalk\Exception\ConnectionException), 0)
#3 /home/ubuntu/idarex/vendor/yiisoft/yii2/log/Target.php(241): yii\helpers\BaseVarDumper::export(Object(Pheanstalk\Exception\ConnectionException))
#4 [internal function]: yii\log\Target->formatMessage(Array)
#5 /home/ubuntu/idarex/vendor/yiisoft/yii2/log/FileTarget.php(106): array_map(Array, Array)
#6 /home/ubuntu/idarex/vendor/yiisoft/yii2/log/Tar in /home/ubuntu/.composer/vendor/codeception/codeception/src/Codeception/Subscriber/ErrorHandler.php on line 49

PHP Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 1046740958 bytes) in /home/ubuntu/idarex/vendor/yiisoft/yii2/helpers/BaseVarDumper.php on line 187 cd tests; codecept run && cd - || exit 1 returned exit code 1

使用SSH结果进行调试:

Tests\codeception\mobile.unit Tests (0) -----
---------------------------------------------


[tests\codeception\mobile]: tests from /home/ubuntu/idarex/tests//codeception/mobile

Time: 7.22 seconds, Memory: 31.50Mb

OK (24 tests, 52 assertions)

我试图在依赖项中设置memory_limit。

$ echo "memory_limit = 2048M" > ~/.phpenv/versions/$(phpenv global)/etc/conf.d/memory.ini

但结果也失败了。

0 个答案:

没有答案
相关问题