Comments (17)
Mind sharing what OS you are on and the exact command you are using?
from paratest.
I observed the issue with blocking tests when executing a single TestCase (1 class) with paratest. Multiple classes are executed parallel.
from paratest.
Just to double check, are you guys using the functional option (-f)? -f informs paratest to run each method in parallel rather than each class. This option was designed for selenium tests.
from paratest.
@brianium - I am using Windows 7, I am also using the -f option.
The TestCase is a single class that inherits about one hundred different tests. I was expecting patatest to execute the testXXX functions within the file in parallel.
I used Zend Debugger to step throught the code and the tests are queued up correctly, but when they executed they block - from memory it was blocking reading the executing status from the pipe.
from paratest.
Hmmm.. Seems like it might be a windows issue with proc_open. Any way you can share your tests?
from paratest.
I have an update to this issue. I spent sometime yesterday attemting to debug the issue, so today I have made a clean install of patatest using compose (about 30 mins ago).
I have also made a fairly simple test case.
The test are now failing upon execution. As you can see, they execute successfully using phpunit.
c:\temp\paratest>phpunit myParaTest.php
PHPUnit 3.7.31 by Sebastian Bergmann.
..........
Time: 1.03 minutes, Memory: 4.00Mb
OK (10 tests, 10 assertions)
c:\temp\paratest>vendor\bin\paratest.bat -f myParaTest.php
Running phpunit in 5 processes with C:\temp\paratest\vendor\bin\phpunit.bat. Functional mode is on
Catchable fatal error: Argument 1 passed to ParaTest\Logging\JUnit\TestSuite::suiteFromNode() must be an instance of SimpleXMLElement, boolean given, called in C:\temp\paratest\vendor\brianium\parates
t\src\ParaTest\Logging\JUnit\Reader.php on line 193 and defined in C:\temp\paratest\vendor\brianium\paratest\src\ParaTest\Logging\JUnit\TestSuite.php on line 105
from paratest.
Mind sharing your test case so I can try to reproduce?
from paratest.
One second, I am just making it as as small as feasible.
from paratest.
<?php
require "driver/lib/__init__.php";
class SeleniumConfiguration {
const closeBrowser = true;
const defaultHost = 'http://localhost:4444/wd/hub';
const timeout_in_ms = 4000;
const browser = 'chrome';
}
class SeleniumTestCase extends PHPUnit_Framework_TestCase {
public static function setUpBeforeClass() {
class_alias('SeleniumConfiguration', 'config');
$capabilities = array();
$capabilities[WebDriverCapabilityType::BROWSER_NAME] = config::browser;
self::$session = RemoteWebDriver::create(
config::defaultHost,
$capabilities,
config::timeout_in_ms);
}
public static function tearDownAfterClass() {
if (config::closeBrowser) {
self::$session->close();
}
}
protected static $session;
protected function openAny($url) {
self::$session->get($url);
}
protected function xpath($path) {
return self::$session->findElement(WebDriverBy::xpath($path));
}
protected function wait($seconds = 5) {
sleep($seconds);
}
/***************************/
const middleDotChar = "\xc2\xb7";
public function testA() {
$this->doSameTest();
}
public function testB() {
$this->doSameTest();
}
public function testC() {
$this->doSameTest();
}
public function testD() {
$this->doSameTest();
}
function doSameTest() {
$this->openAny('https://www.google.co.uk/?gl=us#q=paratest');
sleep(5);
$heading = $this->xpath("//a[contains(text(), 'brianium/')]");
$this->assertEquals('brianium/paratest '.self::middleDotChar.' GitHub', $heading->getText(), 'Anchor text does not match');
}
}
The above tests are working correctly with phpunit and selenium.
from paratest.
require "driver/lib/init.php";
Refers to RemoteWebdriver: https://code.google.com/p/selenium/wiki/RemoteWebDriver
I have tried again without the RemoteWebdriver.
class SeleniumTestCase extends PHPUnit_Framework_TestCase {
public static function setUpBeforeClass() {
}
public static function tearDownAfterClass() {
}
public function testA() {
$this->doSameTest();
}
public function testB() {
$this->doSameTest();
}
public function testC() {
$this->doSameTest();
}
public function testD() {
$this->doSameTest();
}
function doSameTest() {
sleep(5);
}
}
The above code results in:
Running phpunit in 5 processes with C:\temp\paratest\vendor\bin\phpunit.bat. Functional mode is on
Catchable fatal error: Argument 1 passed to ParaTest\Logging\JUnit\TestSuite::suiteFromNode() must be an instance of SimpleXMLElement, boolean given, called in C:\temp\paratest\vendor\brianium\parates
t\src\ParaTest\Logging\JUnit\Reader.php on line 193 and defined in C:\temp\paratest\vendor\brianium\paratest\src\ParaTest\Logging\JUnit\TestSuite.php on line 105
from paratest.
The error in ParaTest\Logging\JUnit\TestSuite::suiteFromNode() is due to the log file being empty
<?xml version="1.0" encoding="UTF-8"?>
<testsuites/>
from paratest.
That usually means a process crashed.
from paratest.
OK, I have resolved that issue - it's the same one I encountered yesterday, so I should have remembered!
File: brianium\paratest\src\ParaTest\Runners\PHPUnit\TestMethod.php
protected function prepareOptions($options)
{
$options['filter'] = sprintf("'/\b%s\b/'", $this->name);
return $options;
}
phpunit on windows will not accept /\b \b/ in the filer, removing this resolves the error.
protected function prepareOptions($options)
{
$options['filter'] = sprintf("'%s'", $this->name);
return $options;
}
from paratest.
A did a little more digging on this issue over the weekend and it appears to be a bug in the Symphony Process module.
[Process] Process::start is blocking on windows #9755: symfony/symfony#9755
It is related to this PHP bug: https://bugs.php.net/bug.php?id=51800
from paratest.
symfony/symfony#9755 has been fixed and merged into 2.3.
@khards can you verify that paratest works correctly on windows now?
from paratest.
Downloaded for first time today, trying to run the example from your instructions and getting what appears to be this issue. Assuming that 'merged into 2.3' refers to symfony\Component\Process, I've looked changelog for this shows version 2.4
vendor\bin\paratest.bat -p 2 -f --phpunit=vendor\bin\phpunit.bat WebDriverDemo.php
Running phpunit in 2 processes with vendor\bin\phpunit.bat. Functional mode is on
PHP Catchable fatal error: Argument 1 passed to ParaTest\Logging\JUnit\TestSuite::suiteFromNode() must be an instance of SimpleXMLElement, boolean given, called in vendor\brianium\paratest\src\ParaTest\Logging\JUnit\Reader.php on line 193 and defined in vendor\brianium\paratest\src\ParaTest\Logging\JUnit\TestSuite.php on line 105
from paratest.
This issue has gone two months without activity. In another two weeks, I will close it.
But! If you comment or otherwise update it, I will reset the clock, and if you label it Backlog
or In Progress
, I will leave it alone ... forever!
from paratest.
Related Issues (20)
- Too few arguments to function `PHPUnit\\TestRunner\\TestResult\\TestResult::__construct()`
- Dependency Dashboard
- Fatal Error JUnit HOT 2
- The "--parallel-suite" option does not exist. HOT 2
- Multiple skipped not reported HOT 4
- SQLSTATE[HY000]: General error: 11 database disk image is malformed HOT 2
- paratest_for_phpstorm deadlock issues where not present in command line runner HOT 3
- WorkerCrashedException on class not found HOT 1
- Bad progress output with option --functional HOT 5
- PHPStorm on Windows: Missing path to '/paratest_for_phpstorm' HOT 2
- Reversion from v6: Output test descriptions while tests are running with --testdox HOT 3
- PHPUnit 11 support HOT 4
- Cache for static analysis has not been configured HOT 3
- Dynamically allocate tests to available workers HOT 1
- Bug with --testdox option at v7.4.0 HOT 3
- Unit testing failing on multiple database connection HOT 1
- After upgrading our app to Laravel 10 + php 8.2, I keep getting "Test was run in child process and ended unexpectedly" with parallel testing on github HOT 4
- Performance issue on new machine HOT 2
- Wait between test HOT 4
- Issue with teamcity reporting in PhpStorm HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from paratest.