Giter VIP home page Giter VIP logo

Comments (15)

dbaltas avatar dbaltas commented on June 20, 2024

Great idea! Bootstrap can be really slow on large applications.
I tried to run paratest from the reuse_bootstrap branch but the process seems to fall on an infinite loop, it never ends.
Please provide instructions on how to run it. Ideally we could run it on the test suite of paratest which can be a reference point for all people involved.

from paratest.

giorgiosironi avatar giorgiosironi commented on June 20, 2024

The branch is not ready, I posted it for feedback on the solution adopted (worker processes).

from paratest.

brianium avatar brianium commented on June 20, 2024

This is a really great idea. I really like the idea of a new runner i.e bin/phpunit-wrapper.

from paratest.

giorgiosironi avatar giorgiosironi commented on June 20, 2024

Update.
I have the Worker implementation running in the branch; it has still some issues on correctness as a round of tests is not reported and I need to deal with Fatal Error in Workers.
However, as you can see from giorgiosironi@5150ddc Paratest is again on par with PHPUnit for 1) long bootstraps and 2) small tests. The next step would be improvement on PHPUnit's execution time, but I need to experiment on a machine with more than 2 cores.

from paratest.

brianium avatar brianium commented on June 20, 2024

Awesome! I've been super swamped with work, but I can't wait to get a minute to dive in and look at all these great additions.

from paratest.

Seldaek avatar Seldaek commented on June 20, 2024

This sounds great, because here I am experiencing a slowdown by using paratest on 4 cores. It uses loads more CPU than phpunit, but runs 20% slower.

from paratest.

dbaltas avatar dbaltas commented on June 20, 2024

please ignore reference above, it was planned for #28

from paratest.

dbaltas avatar dbaltas commented on June 20, 2024

Hey Giorgio,
I get the following error when runnig paratest from giorgiosironi/reuse_bootstrap branch.
Am I missing something in the arguments?

 ~/projects/lib/composer (master)$ ../../paratest/bin/paratest --bootstrap tests/bootstrap.php --runner WrapperRunner
Running phpunit in 5 processes with /home/dbaltas/projects/paratest/vendor/bin/phpunit
Configuration read from /home/dbaltas/projects/lib/composer/phpunit.xml.dist

  [RuntimeException]                                
  This worker has crashed. Last executed command:   

paratest [-p|--processes="..."] [-f|--functional] [-h|--help] [--phpunit="..."] [--runner="..."] [--bootstrap="..."] [-c|--configuration="..."] [-g|--group="..."] [--log-junit="..."] [--path="..."] [path]

This error can be reproduced by running the composer/composer test suite, which runs smoothly with paratest from brianium/master branch.

from paratest.

giorgiosironi avatar giorgiosironi commented on June 20, 2024

I'm doing a push later today improving the error messages.

On Sat, Mar 2, 2013 at 4:20 PM, Dimitris Baltas [email protected]:

Hey Giorgio,

I get the following error when runnig paratest from
giorgiosironi/reuse_bootstrap branch.

Am I missing something in the arguments?

~/projects/lib/composer (master)$ ../../paratest/bin/paratest --bootstrap tests/bootstrap.php --runner WrapperRunner
Running phpunit in 5 processes with /home/dbaltas/projects/paratest/vendor/bin/phpunit
Configuration read from /home/dbaltas/projects/lib/composer/phpunit.xml.dist

[RuntimeException]
This worker has crashed. Last executed command:

paratest [-p|--processes="..."] [-f|--functional] [-h|--help] [--phpunit="..."] [--runner="..."] [--bootstrap="..."] [-c|--configuration="..."] [-g|--group="..."] [--log-junit="..."] [--path="..."] [path]

This error can be reproduced by running the composer/composer test suite,
which runs smoothly with paratest from brianium/master branch.


Reply to this email directly or view it on GitHubhttps://github.com//issues/26#issuecomment-14329632
.

Giorgio Sironi (@giorgiosironi)
http://giorgiosironi.com http://giorgiosironi.blogspot.com/

from paratest.

giorgiosironi avatar giorgiosironi commented on June 20, 2024

Push done! Hope it tells you a bit more now, the WrapperRunner works on Paratest fixture test suite.

from paratest.

giorgiosironi avatar giorgiosironi commented on June 20, 2024

This is what I get now (daf91a0):

[17:31:45][giorgio@Desmond:~/code/composer]$ vendor/bin/phpunit tests/
PHPUnit 3.7.14 by Sebastian Bergmann.

Configuration read from /home/giorgio/code/composer/phpunit.xml.dist

...............................................................  63 / 905 (  6%)
............................................................... 126 / 905 ( 13%)
............................................................... 189 / 905 ( 20%)
............................................................... 252 / 905 ( 27%)
............................................................... 315 / 905 ( 34%)
............................................................... 378 / 905 ( 41%)
............................................................... 441 / 905 ( 48%)
............................................................... 504 / 905 ( 55%)
............................................................... 567 / 905 ( 62%)
............................................................... 630 / 905 ( 69%)
............................................................... 693 / 905 ( 76%)
............................................................... 756 / 905 ( 83%)
............................................................... 819 / 905 ( 90%)
............................................................... 882 / 905 ( 97%)
...........

Time: 2 seconds, Memory: 28.50Mb

OK (893 tests, 1588 assertions)
[17:32:57][giorgio@Desmond:~/code/composer]$ ../paratest/bin/paratest --bootstrap tests/bootstrap.php tests/

Running phpunit in 5 processes with /home/giorgio/code/paratest/vendor/bin/phpunit

Configuration read from /home/giorgio/code/composer/phpunit.xml.dist

.............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................

Time: 4 seconds, Memory: 11.25Mb

OK (893 tests, 1588 assertions)
[17:33:11][giorgio@Desmond:~/code/composer]$ ../paratest/bin/paratest --bootstrap tests/bootstrap.php --runner WrapperRunner tests/

Running phpunit in 5 processes with /home/giorgio/code/paratest/vendor/bin/phpunit

Configuration read from /home/giorgio/code/composer/phpunit.xml.dist

.............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................

Time: 2 seconds, Memory: 11.00Mb

OK (893 tests, 1588 assertions)

from paratest.

dbaltas avatar dbaltas commented on June 20, 2024

It works now!

In the following example i used only one process, otherwise, the times were too small to compare

branch: giorgiosironi/reuse_bootstrap

 ~/projects/lib/composer (master)$ time ../../paratest/bin/paratest -p 1 --bootstrap tests/bootstrap.php --runner WrapperRunner

Running phpunit in 1 process with /home/dbaltas/projects/paratest/vendor/bin/phpunit

Configuration read from /home/dbaltas/projects/lib/composer/phpunit.xml.dist

.............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................

Time: 3 seconds, Memory: 12.25Mb

OK (893 tests, 1588 assertions)

real    0m4.170s
user    0m3.528s
sys 0m0.320s

branch: brianium/master

 ~/projects/lib/composer (master)$ time ../../paratest/bin/paratest -p 1 --bootstrap tests/bootstrap.php 

Running phpunit in 1 process with /home/dbaltas/projects/paratest/vendor/bin/phpunit

Configuration read from /home/dbaltas/projects/lib/composer/phpunit.xml.dist

.............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................

Time: 7 seconds, Memory: 12.00Mb

At some point though I got this error. (only once after 10-15 runs, so I can not reproduce it if requested)

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 74 and defined in /home/dbaltas/projects/paratest/src/ParaTest/Runners/PHPUnit/Worker.php on line 42
PHP Stack trace:
PHP   1. {main}() /home/dbaltas/projects/paratest/bin/paratest:0
PHP   2. Symfony\Component\Console\Application->run() /home/dbaltas/projects/paratest/bin/paratest:35
PHP   3. ParaTest\Console\ParaTestApplication->doRun() /home/dbaltas/projects/paratest/vendor/symfony/console/Symfony/Component/Console/Application.php:106
PHP   4. Symfony\Component\Console\Application->doRun() /home/dbaltas/projects/paratest/src/ParaTest/Console/ParaTestApplication.php:27
PHP   5. Symfony\Component\Console\Command\Command->run() /home/dbaltas/projects/paratest/vendor/symfony/console/Symfony/Component/Console/Application.php:193
PHP   6. ParaTest\Console\Commands\ParaTestCommand->execute() /home/dbaltas/projects/paratest/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:240
PHP   7. ParaTest\Console\Testers\PHPUnit->execute() /home/dbaltas/projects/paratest/src/ParaTest/Console/Commands/ParaTestCommand.php:30
PHP   8. ParaTest\Runners\PHPUnit\WrapperRunner->run() /home/dbaltas/projects/paratest/src/ParaTest/Console/Testers/PHPUnit.php:38
PHP   9. ParaTest\Runners\PHPUnit\WrapperRunner->assignAllPendingTests() /home/dbaltas/projects/paratest/src/ParaTest/Runners/PHPUnit/WrapperRunner.php:30
PHP  10. ParaTest\Runners\PHPUnit\Worker->assign() /home/dbaltas/projects/paratest/src/ParaTest/Runners/PHPUnit/WrapperRunner.php:74

I shall provide some more feedback - from a larger test suite - this coming week.

from paratest.

dbaltas avatar dbaltas commented on June 20, 2024

I am getting the following error when running our suite through WrapperRunner

[RuntimeException]                                                                                                                                                                                        
  This worker has crashed. Last executed command: PARATEST=1 /usr/bin/phpunit --no-globals-backup --bootstrap tests/bootstrap.php --configuration /home/dbaltas/projects/tp24/phpunit.xml --log-junit /tmp  
  /PT_AGjMOu tests/application/models/Hotel/Parameters/TableTest.php                                                                                                                                        
  Output:                                                                                                                                                                                                   
  ----------------------                                                                                                                                                                                    
  Worker starting                                                                                                                                                                                           
  Executing: PARATEST=1 /usr/bin/phpunit --no-globals-backup --bootstrap tests/bootstrap.php --configuration /home/dbaltas/projects/tp24/phpunit.xml --log-junit /tmp/PT_AGjMOu tests/application/models/H  
  otel/Parameters/TableTest.php                                                                                                                                                                             

  Fatal error: Uncaught exception 'Zend_Session_Exception' with message 'Session must be started before any output has been sent to the browser; output started in /home/dbaltas/projects/rnd/paratest/bin  
  /phpunit-wrapper/3' in /home/dbaltas/projects/tp24/library/Zend/Session.php on line 451                                                                                                                   

  Zend_Session_Exception: Session must be started before any output has been sent to the browser; output started in /home/dbaltas/projects/rnd/paratest/bin/phpunit-wrapper/3 in /home/dbaltas/projects/tp  
  24/library/Zend/Session.php on line 451                                                                                                                                                                   

Could it be that the WrapperRunner prints some output to stdout, before the session starts in the test suite?

from paratest.

giorgiosironi avatar giorgiosironi commented on June 20, 2024

Yes, definitely possible as it prints things like "FINISHED\n" after a
test, but are you sure calling session-start() from the cli is correct?
Zend_Session should have a simulation mode for acceptance tests.
Il giorno 07/mar/2013 18.15, "Dimitris Baltas" [email protected]
ha scritto:

I am getting the following error when running our suite through
WrapperRunner

[RuntimeException]
This worker has crashed. Last executed command: PARATEST=1 /usr/bin/phpunit --no-globals-backup --bootstrap tests/bootstrap.php --configuration /home/dbaltas/projects/tp24/phpunit.xml --log-junit /tmp
/PT_AGjMOu tests/application/models/Hotel/Parameters/TableTest.php
Output:


Worker starting
Executing: PARATEST=1 /usr/bin/phpunit --no-globals-backup --bootstrap tests/bootstrap.php --configuration /home/dbaltas/projects/tp24/phpunit.xml --log-junit /tmp/PT_AGjMOu tests/application/models/H
otel/Parameters/TableTest.php

Fatal error: Uncaught exception 'Zend_Session_Exception' with message 'Session must be started before any output has been sent to the browser; output started in /home/dbaltas/projects/rnd/paratest/bin
/phpunit-wrapper/3' in /home/dbaltas/projects/tp24/library/Zend/Session.php on line 451

Zend_Session_Exception: Session must be started before any output has been sent to the browser; output started in /home/dbaltas/projects/rnd/paratest/bin/phpunit-wrapper/3 in /home/dbaltas/projects/tp
24/library/Zend/Session.php on line 451

Could it be that the WrapperRunner prints some output to stdout, before
the session starts in the test suite?


Reply to this email directly or view it on GitHubhttps://github.com//issues/26#issuecomment-14573429
.

from paratest.

dbaltas avatar dbaltas commented on June 20, 2024

This is implemented as the Wrapper Runner, and is already in master.

from paratest.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.