We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doctrine DBAL 2.9.3 にて Eccube\Tests\Web\Admin\Order\ShippingControllerTest::testAddAndDeleteShipping を実行すると以下のようなエラーが発生する
Eccube\Tests\Web\Admin\Order\ShippingControllerTest::testAddAndDeleteShipping
[2019-11-15 16:48:24] app.ERROR [N/A] [8f6b654] [N/A] [Eccube\Log\Logger:log:68] - システムエラーが発生しました。 ["There is no active transaction","/Users/nanasess/git-repos/ec-cube/vendor/dama/doctrine-test-bundle/src/DAMA/DoctrineTestBundle/Doctrine/DBAL/StaticDriver.php",142,"#0 /Users/nanasess/git-repos/ec-cube/vendor/dama/doctrine-test-bundle/src/DAMA/DoctrineTestBundle/Doctrine/DBAL/StaticDriver.php(142): PDO->rollBack()\n#1 /Users/nanasess/git-repos/ec-cube/vendor/dama/doctrine-test-bundle/src/DAMA/DoctrineTestBundle/PHPUnit/PHPUnitListener.php(18): DAMA\\DoctrineTestBundle\\Doctrine\\DBAL\\StaticDriver::rollBack()\n#2 /Users/nanasess/git-repos/ec-cube/vendor/phpunit/phpunit/src/Framework/TestResult.php(408): DAMA\\DoctrineTestBundle\\PHPUnit\\PHPUnitListener->endTest(Object(Eccube\\Tests\\Web\\Admin\\Order\\ShippingControllerTest), 1.4377460479736)\n#3 /Users/nanasess/git-repos/ec-cube/vendor/phpunit/phpunit/src/Framework/TestResult.php(895): PHPUnit\\Framework\\TestResult->endTest(Object(Eccube\\Tests\\Web\\Admin\\Order\\ShippingControllerTest), 1.4377460479736)\n#4 /Users/nanasess/git-repos/ec-cube/vendor/phpunit/phpunit/src/Framework/TestCase.php(894): PHPUnit\\Framework\\TestResult->run(Object(Eccube\\Tests\\Web\\Admin\\Order\\ShippingControllerTest))\n#5 /Users/nanasess/git-repos/ec-cube/vendor/phpunit/phpunit/src/Framework/TestSuite.php(755): PHPUnit\\Framework\\TestCase->run(Object(PHPUnit\\Framework\\TestResult))\n#6 /Users/nanasess/git-repos/ec-cube/vendor/phpunit/phpunit/src/TextUI/TestRunner.php(545): PHPUnit\\Framework\\TestSuite->run(Object(PHPUnit\\Framework\\TestResult))\n#7 /Users/nanasess/git-repos/ec-cube/bin/.phpunit/phpunit-6.5/src/TextUI/Command.php(195): PHPUnit\\TextUI\\TestRunner->doRun(Object(PHPUnit\\Framework\\TestSuite), Array, true)\n#8 /Users/nanasess/git-repos/ec-cube/bin/.phpunit/phpunit-6.5/src/TextUI/Command.php(148): PHPUnit\\TextUI\\Command->run(Array, true)\n#9 /Users/nanasess/git-repos/ec-cube/bin/.phpunit/phpunit-6.5/phpunit(17): PHPUnit\\TextUI\\Command::main()\n#10 /Users/nanasess/git-repos/ec-cube/vendor/symfony/phpunit-bridge/bin/simple-phpunit(239): include('/Users/nanasess...')\n#11 /Users/nanasess/git-repos/ec-cube/bin/phpunit(18): require('/Users/nanasess...')\n#12 {main}"] [, , , , ]
2.9.2(EC-CUBE4.0.3 で採用しているバージョン) では問題なし
以下の PR が原因の模様 doctrine/dbal#3679
Eccube\Tests\Web\Admin\Order\ShippingControllerTest::testAddAndDeleteShipping が正常に通る
以下のコマンドを実行する
composer require doctrine/dbal "2.9.3" bin/phpunit --exclude-group cache-clear,cache-clear-install,update-schema-doctrine --filter=testAddAndDeleteShipping tests/Eccube/Tests/Web/Admin/Order/ShippingControllerTest.php
The text was updated successfully, but these errors were encountered:
以下、最小限の再現コードです。 2回リクエストをコールした後、 INSERT をするとアクティブではないトランザクションが発生します。
<?php namespace Eccube\Tests\Web; use Eccube\Common\Constant; use Eccube\Entity\ProductClass; class TopControllerTest extends AbstractWebTestCase { public function testRoutingIndex() { $this->client->request('GET', $this->generateUrl('homepage')); $this->client->request('GET', $this->generateUrl('homepage')); $News = new \Eccube\Entity\News(); $News->setTitle('aaa'); $News->setVisible(true); $this->entityManager->persist($News); $this->entityManager->flush(); self::assertTrue(true); } }
Sorry, something went wrong.
2回リクエストをコールした後、
1回目のリクエスト終了時に DoctrineBundle::shutdown() がコールされた際、 Connection が close されてしまうのが根本的な原因の模様。 テスト用の DoctrineBundle を独自に作成することで回避できそう
DoctrineBundle::shutdown()
Doctrine DBAL 2.9.3 Support, Resolve EC-CUBE#4387
3e98987
Successfully merging a pull request may close this issue.
概要(Overview)
Doctrine DBAL 2.9.3 にて
Eccube\Tests\Web\Admin\Order\ShippingControllerTest::testAddAndDeleteShipping
を実行すると以下のようなエラーが発生する2.9.2(EC-CUBE4.0.3 で採用しているバージョン) では問題なし
以下の PR が原因の模様
doctrine/dbal#3679
期待する内容(Expect) or 要望 (Requirement)
Eccube\Tests\Web\Admin\Order\ShippingControllerTest::testAddAndDeleteShipping
が正常に通る再現手順(Procedure)
以下のコマンドを実行する
環境 (environment)
関連情報 (Ref)
The text was updated successfully, but these errors were encountered: