Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WrapperRunner randomly throwing a Fatal Error #54

Closed
dbaltas opened this issue Jul 1, 2013 · 8 comments
Closed

WrapperRunner randomly throwing a Fatal Error #54

dbaltas opened this issue Jul 1, 2013 · 8 comments

Comments

@dbaltas
Copy link
Contributor

dbaltas commented Jul 1, 2013

The error below happened on this travis build

1) PHPUnitTest::testRunWithFatalRuntimeErrorWithTheWrapperRunnerOutputsError
Failed asserting that 'PHP Catchable fatal error:  Argument 1 passed to ParaTest\Runners\PHPUnit\Worker::assign() must be an instance of ParaTest\Runners\PHPUnit\ExecutableTest, null given, called in /home/travis/build/brianium/paratest/src/ParaTest/Runners/PHPUnit/WrapperRunner.php on line 86 and defined in /home/travis/build/brianium/paratest/src/ParaTest/Runners/PHPUnit/Worker.php on line 47
PHP Stack trace:

It also happens on my dev (on around 70% of the runs) machine when running

bin/paratest -p 2 --runner WrapperRunner test/fixtures/tests/EnvironmentTest.php
@dbaltas
Copy link
Contributor Author

dbaltas commented Jul 1, 2013

Findings

When count($this->modified) (on WrapperRunner) is bigger than one, then the exception is thrown.
When count($this->modified) == 1 the test suite pass.

To reproduce

check out tripsta/paratest/issues/54-wrapper-runner-exception and run

bin/paratest -p 2 --runner WrapperRunner test/fixtures/tests/EnvironmentTest.php

Example of exception

worker count in startWorkers 2
pending count 1
modifed count 2
worker count in progressedWorkers 2
PHP Catchable fatal error: Argument 1 passed to ParaTest\Runners\PHPUnit\Worker::assign() must be an instance of ParaTest\Runners\PHPUnit\ExecutableTest, null given, called in /home/dbaltas/projects/paratest/src/ParaTest/Runners/PHPUnit/WrapperRunner.php on line 89 and defined in /home/dbaltas/projects/paratest/src/ParaTest/Runners/PHPUnit/Worker.php on line 47

Example of success

worker count in startWorkers 2
pending count 1
modifed count 1
worker count in progressedWorkers 1
modifed count 1
worker count in progressedWorkers 1
modifed count 1
worker count in progressedWorkers 1
modifed count 1
worker count in progressedWorkers 1
modifed count 1
worker count in progressedWorkers 1
modifed count 1
worker count in progressedWorkers 1
modifed count 1
worker count in progressedWorkers 1
modifed count 1
worker count in progressedWorkers 1
..

Time: 0 seconds, Memory: 3.25Mb

OK (2 tests, 6 assertions)

@giorgiosironi
Copy link
Contributor

Thank you for the investigation, since it can be reproduced I'll try to fix
this issue.

dbaltas added a commit that referenced this issue Jul 4, 2013
@dbaltas
Copy link
Contributor Author

dbaltas commented Jul 4, 2013

@giorgiosironi Is the above fix OK?
Also this issue still persists in last builds of master in travis 118,121, even though it passed on 119 with the same code as 121,

1) PerformanceTest::testRunningSuitesWithLongBootstrapsIsFasterWithTheWrapperRunner
Symfony\Component\Process\Exception\RuntimeException: The process timed-out.

@giorgiosironi
Copy link
Contributor

Yes, the fix is ok as this is a race condition between $this->pending and "more workers than pending tests" being available in a single shot. I'll look at master and see if I can reproduce the issue.

@giorgiosironi
Copy link
Contributor

I'll download a 5.3 VM to get the same problem.

@giorgiosironi
Copy link
Contributor

Reproduced on 5.3.10, with a similar test. Symfony/Process has a default timeout of 60 seconds for a process (don't know between which events it is measured), and that stops the suite.
PHP 5.3 is nototiously slower than 5.4, so that's probably why it is happening only in that environment.

@giorgiosironi
Copy link
Contributor

I got a green build here:
https://travis-ci.org/giorgiosironi/paratest
and the identical commit failing on 5.3 here:
https://travis-ci.org/brianium/paratest

@dbaltas
Copy link
Contributor Author

dbaltas commented Jul 21, 2013

Its OK. Thumbs up!

@dbaltas dbaltas closed this as completed Jul 21, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants