Skip to content

Commit 8ec0403

Browse files
committed
Stopped marking transaction in integration tests as inactive although still active
Before an integration test is started the testing framework begins a new database transaction so that all changes to the database can be reverted after the test completed. The testing framework also offers a way to easily load data fixtures during this transaction with the help of the attribute. But in case of faulty fixtures an exception or error can occure. Currently this will prevent the event from rollback the transaction and so the tests fail with the error message 'Fatal error: Some transactions have not been committed or rolled back in /var/www/html/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php on line 4169'. The issue is that the catch block in the Transaction event marks the transaction as 'inactive' so that it won't be rolled back at the end of the test, although the transaction is still open. This is fixed now.
1 parent 88660e7 commit 8ec0403

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

dev/tests/integration/framework/Magento/TestFramework/Event/Transaction.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ function ($errNo, $errStr, $errFile, $errLine) use ($test) {
111111
$this->_eventManager->fireEvent('startTransaction', [$test]);
112112
restore_error_handler();
113113
} catch (\Exception $e) {
114-
$this->_isTransactionActive = false;
115114
$test->getTestResultObject()->addFailure(
116115
$test,
117116
new \PHPUnit\Framework\AssertionFailedError((string)$e),

0 commit comments

Comments
 (0)