service-bus-symfony-bundle icon indicating copy to clipboard operation
service-bus-symfony-bundle copied to clipboard

PhpDumper trying to access unknown `Alias::isShared` method during unit test

Open gquemener opened this issue 6 years ago • 5 comments
trafficstars

Test suite does not pass on master.

Here's the execution result:

PHPUnit 6.5.14 by Sebastian Bergmann and contributors.

....E....E..E.......E.......E....E..E.......E.................... 65 / 75 ( 86%)
..........                                                        75 / 75 (100%)

Time: 2 seconds, Memory: 20.00MB

There were 8 errors:

1) ProophTest\Bundle\ServiceBus\DependencyInjection\XmlServiceBusExtensionTest::it_dumps_multiple_command_buses
Error: Call to undefined method Symfony\Component\DependencyInjection\Alias::isShared()

/app/vendor/symfony/dependency-injection/Dumper/PhpDumper.php:1892
/app/vendor/symfony/dependency-injection/Dumper/PhpDumper.php:184
/app/test/DependencyInjection/AbstractServiceBusExtensionTestCase.php:523
/app/test/DependencyInjection/AbstractServiceBusExtensionTestCase.php:110

2) ProophTest\Bundle\ServiceBus\DependencyInjection\XmlServiceBusExtensionTest::it_dumps_multiple_query_buses
Error: Call to undefined method Symfony\Component\DependencyInjection\Alias::isShared()

/app/vendor/symfony/dependency-injection/Dumper/PhpDumper.php:1892
/app/vendor/symfony/dependency-injection/Dumper/PhpDumper.php:184
/app/test/DependencyInjection/AbstractServiceBusExtensionTestCase.php:523
/app/test/DependencyInjection/AbstractServiceBusExtensionTestCase.php:248

3) ProophTest\Bundle\ServiceBus\DependencyInjection\XmlServiceBusExtensionTest::it_dumps_multiple_event_buses
Error: Call to undefined method Symfony\Component\DependencyInjection\Alias::isShared()

/app/vendor/symfony/dependency-injection/Dumper/PhpDumper.php:1892
/app/vendor/symfony/dependency-injection/Dumper/PhpDumper.php:184
/app/test/DependencyInjection/AbstractServiceBusExtensionTestCase.php:523
/app/test/DependencyInjection/AbstractServiceBusExtensionTestCase.php:300

4) ProophTest\Bundle\ServiceBus\DependencyInjection\XmlServiceBusExtensionTest::it_dumps_async_switch_command_bus
Error: Call to undefined method Symfony\Component\DependencyInjection\Alias::isShared()

/app/vendor/symfony/dependency-injection/Dumper/PhpDumper.php:1892
/app/vendor/symfony/dependency-injection/Dumper/PhpDumper.php:184
/app/test/DependencyInjection/AbstractServiceBusExtensionTestCase.php:523
/app/test/DependencyInjection/AbstractServiceBusExtensionTestCase.php:444

5) ProophTest\Bundle\ServiceBus\DependencyInjection\YamlServiceBusExtensionTest::it_dumps_multiple_command_buses
Error: Call to undefined method Symfony\Component\DependencyInjection\Alias::isShared()

/app/vendor/symfony/dependency-injection/Dumper/PhpDumper.php:1892
/app/vendor/symfony/dependency-injection/Dumper/PhpDumper.php:184
/app/test/DependencyInjection/AbstractServiceBusExtensionTestCase.php:523
/app/test/DependencyInjection/AbstractServiceBusExtensionTestCase.php:110

6) ProophTest\Bundle\ServiceBus\DependencyInjection\YamlServiceBusExtensionTest::it_dumps_multiple_query_buses
Error: Call to undefined method Symfony\Component\DependencyInjection\Alias::isShared()

/app/vendor/symfony/dependency-injection/Dumper/PhpDumper.php:1892
/app/vendor/symfony/dependency-injection/Dumper/PhpDumper.php:184
/app/test/DependencyInjection/AbstractServiceBusExtensionTestCase.php:523
/app/test/DependencyInjection/AbstractServiceBusExtensionTestCase.php:248

7) ProophTest\Bundle\ServiceBus\DependencyInjection\YamlServiceBusExtensionTest::it_dumps_multiple_event_buses
Error: Call to undefined method Symfony\Component\DependencyInjection\Alias::isShared()

/app/vendor/symfony/dependency-injection/Dumper/PhpDumper.php:1892
/app/vendor/symfony/dependency-injection/Dumper/PhpDumper.php:184
/app/test/DependencyInjection/AbstractServiceBusExtensionTestCase.php:523
/app/test/DependencyInjection/AbstractServiceBusExtensionTestCase.php:300

8) ProophTest\Bundle\ServiceBus\DependencyInjection\YamlServiceBusExtensionTest::it_dumps_async_switch_command_bus
Error: Call to undefined method Symfony\Component\DependencyInjection\Alias::isShared()

/app/vendor/symfony/dependency-injection/Dumper/PhpDumper.php:1892
/app/vendor/symfony/dependency-injection/Dumper/PhpDumper.php:184
/app/test/DependencyInjection/AbstractServiceBusExtensionTestCase.php:523
/app/test/DependencyInjection/AbstractServiceBusExtensionTestCase.php:444

ERRORS!
Tests: 75, Assertions: 158, Errors: 8.

I'm currently investigating for the cause of this issue. Any hint is welcome :)

gquemener avatar Oct 04 '19 07:10 gquemener

FYI

$ composer show
....
symfony/dependency-injection       v4.3.4   Symfony DependencyInjection Component
...

gquemener avatar Oct 04 '19 07:10 gquemener

I am able to register several service buses (using yaml service definitions) within a symfony project using both 0.7.0 and master (b8850e4).

The issue is quite hard to debug as it occurs in the internal gut of the Symfony DI PhpDumper.

gquemener avatar Oct 04 '19 08:10 gquemener

Quick update:

The issue only appears from symfony/dependency-injection:4.2.0.

The testsuite passes with the following versions set : composer require symfony/dependency-injection:4.1.12 symfony/http-kernel:4.1 symfony/framework-bundle:4.1

gquemener avatar Oct 10 '19 09:10 gquemener

I've opened a PR on Symfony to fix this bug: https://github.com/symfony/symfony/pull/33958.

However, once fixed the testsuite complains about a bunch of unknown services. I guess they were somehow auto-registered in the past versions of Symfony, and are not anymore (but that's just a wild guess).

Side note: a good improvement would be to run the testsuite against several versions of Symfony.

gquemener avatar Oct 11 '19 17:10 gquemener

UPDATE: the fix has been merged on Symfony:4.3-dev, let's wait for a new Symfony 4.3 release.

gquemener avatar Oct 14 '19 11:10 gquemener