My phpunit.xml
PhpUnit ... Killed Dlaczego został zabity?
<phpunit
bootstrap="bootstrap.php"
backupGlobals="false"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
>
<testsuites>
<testsuite>
<directory suffix="Test.php">./tests</directory>
</testsuite>
</testsuites>
<logging>
<log type="coverage-html" target="coverage" lowUpperBound="75" highUpperBound="100" />
</logging>
</phpunit>
My bootstrap.php
:
<?php
/** ---------------------------------------------------- **/
// Require the vendors autoload file.
/** ---------------------------------------------------- **/
require_once 'vendor/autoload.php';
/** ---------------------------------------------------- **/
// We neeed WordPress Bootstrap files for its test.
/** ---------------------------------------------------- **/
define('WP_TEST_DIR', parse_ini_file('test-config.ini')['test-location']);
// Include the bootstrap file.
require_once WP_TEST_DIR . 'includes/bootstrap.php';
// Include the Functions file
require_once WP_TEST_DIR . 'includes/functions.php';
Kiedy uruchomić ten z sekcji logowania komentarzem, otrzymuję:
[email protected]:/vagrant/Freya/Routes$ phpunit
Installing...
Running as single site... To run multisite, use -c tests/phpunit/multisite.xml
Not running ajax tests. To execute these, use --group ajax.
Not running ms-files tests. To execute these, use --group ms-files.
Not running external-http tests. To execute these, use --group external-http.
PHPUnit 4.6.6 by Sebastian Bergmann and contributors.
Configuration read from /vagrant/Freya/Routes/phpunit.xml
...............Killed
Kiedy wykomentuj rejestrowanie uzyskać:
[email protected]:/vagrant/Freya/Routes$ phpunit
Installing...
Running as single site... To run multisite, use -c tests/phpunit/multisite.xml
Not running ajax tests. To execute these, use --group ajax.
Not running ms-files tests. To execute these, use --group ms-files.
Not running external-http tests. To execute these, use --group external-http.
PHPUnit 4.6.6 by Sebastian Bergmann and contributors.
Configuration read from /vagrant/Freya/Routes/phpunit.xml
..................................
Time: 9.64 seconds, Memory: 45.50Mb
OK (34 tests, 38 assertions)
Dlaczego umiera bez widocznych błędów? czy to jest problem z pamięcią? Jeśli tak, czemu nie powiedzieć? Te zestawy testów zawierają pakiet testowy WordPress klasy WP_UnitTestCase
, który pozwala mi skonfigurować fałszywą instalację Wordpressa dla niektórych testów. Ale jak widzisz, po drugim uruchomieniu testów z zakomentowanym logowaniem uzyskuje się pamięć 45.50 Mb . To nic.
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
display_errors = On
display_startup_errors = Off
wersja PHP jest 5.5.9
Co się dzieje? (Tak folder pokrycie istnieje)
Update 1
Okazuje się, że dmesg
pokazuje:
[942618.313174] Out of memory: Kill process 12987 (php) score 384 or sacrifice child
[942618.315188] Killed process 12987 (php) total-vm:453360kB, anon-rss:192380kB, file-rss:12kB
[942757.404416] php5-fpm invoked oom-killer: gfp_mask=0x201da, order=0, oom_score_adj=0
[942757.404421] php5-fpm cpuset=/ mems_allowed=0
[942757.404424] CPU: 0 PID: 16427 Comm: php5-fpm Tainted: G OX 3.13.0-37-generiC#64-Ubuntu
[942757.404426] Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006
[942757.404428] 0000000000000000 ffff88000200d980 ffffffff8171ed09 ffff88001dfbb000
[942757.404431] ffff88000200da08 ffffffff817195c4 0000000000000000 0000000000000000
[942757.404432] 0000000000000000 0000000000000000 0000000000000000 0000000000000000
musiałbym zwiększyć pamięć PHP w tym przypadku?
Sprawdź 'dmesg', aby zobaczyć, czy rzeczywiście został zabity przez zabójcę OOM. – VolenD
Pamięć używana przez zabity proces wynosi 192 MB zgodnie z dziennikiem dmesg. Domyślam się, że VM nie ma wystarczającej ilości wolnej pamięci (możesz monitorować ją za pomocą 'top' gdy testy są uruchomione). Musisz więc zwiększyć pamięć VM (zwiększenie pamięci PHP nie pomoże ci). – VolenD
Zwiększyłem pamięć PHP do 550 MB i rozwiązałem problem, VM ma 2 koncerty, gdzie jako php mem było 120M – TheWebs