Skip to content
New issue

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

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

Open
gquemener opened this issue Oct 4, 2019 · 5 comments

Comments

@gquemener
Copy link
Contributor

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
Copy link
Contributor Author

FYI

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

@gquemener gquemener changed the title Unit tests fail to pass on master PhpDumper trying to access unknown Alias::isShared method during unit test Oct 4, 2019
@gquemener
Copy link
Contributor Author

gquemener commented Oct 4, 2019

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
Copy link
Contributor Author

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
Copy link
Contributor Author

I've opened a PR on Symfony to fix this bug: symfony/symfony#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
Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant