mio phpunit.xml
PhpUnit ... Ucciso Perché viene ucciso?
<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>
mio 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';
Quando eseguo questo con la sezione di registrazione senza commenti, ottengo:
[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
Quando io commento registrazione ottengo:
[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)
Perché muore senza errori visibili? è un problema di memoria? Se è così, perché non dirlo? Questi set di test includono la suite di test WordPress classe WP_UnitTestCase
per consentirmi di configurare un'installazione di Wordpress falsa per alcuni test Ma, come puoi vedere la seconda volta che ho eseguito i test con la registrazione, ho ricevuto una memoria 45.50mb usata . Non è niente.
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
display_errors = On
display_startup_errors = Off
versione di PHP è 5.5.9
Che cosa sta succedendo? (Sì esiste la cartella di copertura)
Update 1
scopre che il dmesg
sta mostrando:
[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
avrei bisogno di aumentare la memoria di PHP in questo caso?
Controllare 'dmesg' per vedere se è stato ucciso dall'assassino OOM. – VolenD
La memoria utilizzata dal processo ucciso è 192 MB secondo il registro dmesg. Immagino che la VM non abbia abbastanza memoria libera (puoi controllarla con 'top' mentre i test sono in esecuzione). Quindi, devi aumentare la memoria della VM (aumentare la memoria PHP non ti aiuterà). – VolenD
Ho aumentato il mem PHP a 550 MB e ho risolto il problema, la VM ha 2 concerti, dove il mem php era a 120M – TheWebs