You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Our selenium tests are designed to run on an empty schema, with their own setup and tear down scripts (to ensure any data is reset in each run).
We have over 100 tests and 5000 assertions, when running in parallel, the tests cause unique constraints / failures in the DB when two tests use the same table.
Is it possible to pass through ENV variables to each node, to specify a separate DB hosts for each parallel stack.
Or even better, spread the parallel tests to a docker swarm?
The text was updated successfully, but these errors were encountered:
I've also just run into this issue. I have three test classes operating on the same database table (i.e. seeding, inserting, and asserting data), and I've tried a dozen combinations of setUp/tearDown/setUpBeforeClass/tearDownAfterClass, to little success.
As an example...
<?phpnamespaceTests\Browser;
useFacebook\WebDriver\WebDriverBy;
useLmc\Steward\Test\AbstractTestCase;
useShinka\Atoms\Constants;
useShinka\Atoms\Tests\BrowserAddOnTestCase;
useShinka\Atoms\Tests\TestCase;
classAtomsIndexTestextendsAbstractTestCase
{
useTestCase, BrowserAddOnTestCase;
privateconstCOUNT = 5;
/** * Creates database tables. */publicstaticfunctionsetUpBeforeClass() : void
{
require_once__DIR__ . '/../bootstrap.php';
self::install();
}
/** * Drops database tables. */publicstaticfunctiontearDownAfterClass() : void
{
self::uninstall();
}
/** * Seeds atoms table. */publicfunctionsetUp() : void
{
$this->seedAtoms(self::COUNT);
}
/** * Truncates atoms table. */publicfunctiontearDown() : void
{
$this->emptyTable(Constants::$table);
}
/** * @test */publicfunctionit_gets_index() : void
{
$this->wd->get('http://xen.test/admin.php?atoms/');
$this->login();
}
/** * @test * Fails because another testcase has also seeded and hasn't been torn down yet, so * expected count is doubled */publicfunctionit_lists_atoms() : void
{
$this->wd->get('http://xen.test/admin.php?atoms/');
$this->login();
$rows = $this->findMultipleByClass('dataList-row');
/** @todo figure out why table isn't emptying -- probably something to do with running in parallel */$this->assertCount(self::COUNT, $rows);
}
}
Our selenium tests are designed to run on an empty schema, with their own setup and tear down scripts (to ensure any data is reset in each run).
We have over 100 tests and 5000 assertions, when running in parallel, the tests cause unique constraints / failures in the DB when two tests use the same table.
Is it possible to pass through ENV variables to each node, to specify a separate DB hosts for each parallel stack.
Or even better, spread the parallel tests to a docker swarm?
The text was updated successfully, but these errors were encountered: