Closed VincentLanglet closed 6 months ago
Does it happen without using paratest? I guess not?
How exactly does paratest run multiple tests in parallel? Is it happening in isolated processes? Or in the same php process?
Does it happen without using paratest? I guess not?
I'm sorry, kinda hard for me to answer this.
Our tests runs in ~10 minutes with paratest, without it would be around 30 minutes. And the bug occurs less than 1 times every 10 runs. So I would need to run the tests during hours to try to reproduce this without paratest, without proving anything :/
All I know is that
How exactly does paratest run multiple tests in parallel? Is it happening in isolated processes? Or in the same php process?
According to https://github.com/paratestphp/paratest#initial-setup-for-all-tests "ParaTest runs multiple processes in parallel, each with their own instance of the PHP interpreter," does it answer your question ?
Not sure if it can helps but I also sometimes get the error
Doctrine\DBAL\Driver\PDO\Exception: SQLSTATE[42000]: Syntax error or access violation: 1305 SAVEPOINT DAMA_TEST does not exist
with the stack trace
/var/www/wg-app/vendor/doctrine/dbal/src/Driver/PDO/Connection.php:33
/var/www/wg-app/vendor/doctrine/dbal/src/Driver/Middleware/AbstractConnectionMiddleware.php:46
/var/www/wg-app/vendor/dama/doctrine-test-bundle/src/DAMA/DoctrineTestBundle/Doctrine/DBAL/StaticConnectionTrait.php:65
/var/www/wg-app/vendor/dama/doctrine-test-bundle/src/DAMA/DoctrineTestBundle/Doctrine/DBAL/StaticConnection.php:33
/var/www/wg-app/vendor/doctrine/dbal/src/Driver/Middleware/AbstractConnectionMiddleware.php:86
/var/www/wg-app/vendor/doctrine/dbal/src/Logging/Connection.php:80
/var/www/wg-app/vendor/doctrine/dbal/src/Driver/Middleware/AbstractConnectionMiddleware.php:86
/var/www/wg-app/vendor/symfony/doctrine-bridge/Middleware/Debug/DBAL3/Connection.php:127
/var/www/wg-app/vendor/doctrine/dbal/src/Connection.php:1521
/var/www/wg-app/vendor/doctrine/orm/src/UnitOfWork.php:485
/var/www/wg-app/vendor/doctrine/orm/src/EntityManager.php:403
/var/www/wg-app/src/Manager/AbstractManager.php:153
This seems definitely paratest-related because
Are the different paratest processes using separate databases? Or a shared database?
Are the different paratest processes using separate databases? Or a shared database?
Shared database.
Really hard to tell :thinking:
Doctrine\DBAL\Driver\PDO\Exception: SQLSTATE[42000]: Syntax error or access violation: 1305 SAVEPOINT DAMA_TEST does not exist
Might be a sign that some query (doing DDL like alter table, truncate etc) implicitly committed a transaction which would mean that savepoint is gone.
Really hard to tell 🤔
Doctrine\DBAL\Driver\PDO\Exception: SQLSTATE[42000]: Syntax error or access violation: 1305 SAVEPOINT DAMA_TEST does not exist
Might be a sign that some query (doing DDL like alter table, truncate etc) implicitly committed a transaction which would mean that savepoint is gone.
The fact it doesn't occur every time (and on different tests) makes me think there is conflict between the parallel runner.
I tried to see if it was maybe because of the static properties... Then I just wonder it's because we can maybe have something like
And if this is the reason, I'm not sure I can do something about this concurrency, except having multiple databases...
I tried to see if it was maybe because of the static properties...
Hm yeah but I thought all runners have a separate php process? :thinking: then those static properties should be fine theoretically.
I tried to see if it was maybe because of the static properties...
Hm yeah but I thought all runners have a separate php process? 🤔 then those static properties should be fine theoretically.
Indeed, I just lost time of this idea ^^' So I think it should be the second option :/
I solve the issue by using multiple database.
HI @dmaicher,
I'm recently getting the
Exception in third-party event subscriber: There is no active transaction
sometimes in my CI with this stracktrace:It occurs while running the tests, but
I'm using Paratest https://github.com/paratestphp/paratest and I wonder if it would create some conflict.
I often solve the issue by re-running the ci. I wonder if try/catching the exception wouldn't be an "OK solution".