antonioribeiro / tddd

A Laravel Continuous Integration Package

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Test won't complete, Work will never finish.

kristopherchun opened this issue · comments

WATCHING CONFIG: /srv/www/production/reporting-admin/config/ci.php RUNNING: /usr/bin/script -q /tmp/tw-7Ksd5Q vendor/bin/phpunit /srv/www/production/reporting-admin/tests/Unit/ExampleTest.php

The ExampleTest is just a basic test:

public function testBasicTest() { $this->assertTrue(true); }

I've stepped through the code and it appears to be hanging inside of the Symphony Process.php wait function.

vendor/symfony/process/Process.php

` public function wait(callable $callback = null){
$this->requireProcessIsStarted(FUNCTION);

    $this->updateStatus(false);

    if (null !== $callback) {
        if (!$this->processPipes->haveReadSupport()) {
            $this->stop(0);
            throw new \LogicException('Pass the callback to the Process::start method or enableOutput to use a callback with Process::wait');
        }
        $this->callback = $this->buildCallback($callback);
    }

    do {
        $this->checkTimeout();
        $running = '\\' === DIRECTORY_SEPARATOR ? $this->isRunning() : $this->processPipes->areOpen();
        $this->readPipes($running, '\\' !== DIRECTORY_SEPARATOR || !$running);
    } while ($running);

    while ($this->isRunning()) {
        usleep(1000);
    }

    if ($this->processInformation['signaled'] && $this->processInformation['termsig'] !== $this->latestSignal) {
        throw new RuntimeException(sprintf('The process has been signaled with signal "%s".', $this->processInformation['termsig']));
    }

    return $this->exitcode;
}`

When running ci:work $running never sets itself to false, so it gets stuck inside of the while loop. For somereason "$this->processPipes->areOpen()" never returns as false. I've tried running this basic phpunit test script using ci:work and even after 20+ minutes it never finishes.

The unit tests work fine when running phpunit from command line, "vendor/bin/phpunit /srv/www/production/reporting-admin/tests/Unit/ExampleTest.php"

I have similar issue but my tests are as simple as get to a page see if it's 200 and still it never finishes. Did you find solution?

+1 I am using vagrant, homestead