Skip to content

[Messenger] pcntl PHP extension is required since v6.3.5 with test #52575

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

Closed
wants to merge 2 commits into from

Conversation

SerheyDolgushev
Copy link
Contributor

Q A
Branch? 6.3
Bug fix? yes
New feature? no
Deprecations? no
License MIT

Created this one as the follow-up to #52574. This time I added testBasicApplicationRun test to demonstrate the issue.

Successful run when pcntl extension is installed and pcntl_signal function is available:

php phpunit --filter testBasicApplicationRun src/Symfony/Component/Messenger/Tests/Command/ConsumeMessagesCommandTest.php        
PHPUnit 9.6.13 by Sebastian Bergmann and contributors.

Testing Symfony\Component\Messenger\Tests\Command\ConsumeMessagesCommandTest

                                                                                                                        
 [OK] Consuming messages from transport "dummy-receiver".                                                               
                                                                                                                        

 // The worker will automatically exit once it has processed 1 messages or received a stop signal via the               
 // messenger:stop-workers command.                                                                                     

 // Quit the worker with CONTROL-C.                                                                                     

 // Re-run the command with a -vv option to see logs about consumed messages.                                           

.                                                                   1 / 1 (100%)

Time: 00:00.081, Memory: 12.00 MB

OK (1 test, 4 assertions)

Error when pcntl_signal function is disabled:

php -d disable_functions=pcntl_signal phpunit --filter testBasicApplicationRun src/Symfony/Component/Messenger/Tests/Command/ConsumeMessagesCommandTest.php
PHPUnit 9.6.13 by Sebastian Bergmann and contributors.

Testing Symfony\Component\Messenger\Tests\Command\ConsumeMessagesCommandTest
E                                                                   1 / 1 (100%)

Time: 00:00.655, Memory: 10.00 MB

There was 1 error:

1) Symfony\Component\Messenger\Tests\Command\ConsumeMessagesCommandTest::testBasicApplicationRun
Symfony\Component\Console\Exception\RuntimeException: Unable to subscribe to signal events. Make sure that the "pcntl" extension is installed and that "pcntl_*" functions are not disabled by your php.ini's "disable_functions" directive.

/Users/sergiid/Projects/symfony/src/Symfony/Component/Console/Application.php:1006
/Users/sergiid/Projects/symfony/src/Symfony/Component/Messenger/Tests/Command/ConsumeMessagesCommandTest.php:75

ERRORS!
Tests: 1, Assertions: 0, Errors: 1.

@SerheyDolgushev
Copy link
Contributor Author

FYI @derrabus

@derrabus
Copy link
Member

Please stop opening the same PR over and over again.

#52574 (comment)

@derrabus derrabus closed this Nov 13, 2023
@symfony symfony locked as spam and limited conversation to collaborators Nov 13, 2023
@stof
Copy link
Member

stof commented Nov 14, 2023

Also, note that it is not required "since 6.3.5". There is a single release in which the package failed without ext-pcntl due to a bug. The bug has been fixed in 6.3.6

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

Successfully merging this pull request may close these issues.

4 participants