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

Run tests on PHP 8.3, fix dynamic property for PHP 8.2 and update test suite #40

Open
wants to merge 1 commit into
base: 1.x
Choose a base branch
from

Conversation

yadaiio
Copy link

@yadaiio yadaiio commented Apr 23, 2024

Builds on top of #32, #37 and #39.

References: reactphp/socket#300, clue/reactphp-zenity#63, clue/reactphp-csv#33 and others.

The tests were failing in PHP 5.3 because of an unknown React\Promise\Timer\sleep() function. In order to avoid this I updated this to use the React\Async\delay() function instead.

Additionally I saw the dynamic properties were deprecated since PHP 8.2, see https://www.php.net/releases/8.2/en.php#deprecate_dynamic_properties, so I had to add a new class variable in the CompositeConnection.php file to avoid that the test for PHP 8.2 and PHP 8.3 run infinitely.

@SimonFrings SimonFrings added the new feature New feature or request label Apr 23, 2024
Comment on lines +20 to +22
<php>
<ini name="error_reporting" value="-1" />
</php>
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests for PHP 8.2 and PHP 8.3 are currently running infinitely and I narrowed it down to these three lines being the cause of this. For other pull requests these changes ran smoothly, any idea what is happening here @clue?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks strange. Can you reproduce this locally? Can you try excluding some tests to see which test is causing this? Using groups or excludes or filters might be useful.

Copy link
Author

@yadaiio yadaiio Apr 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @clue, I tried debugging the code to find the cause of this issue and after seeing a new error thrown in line 76 in the CompositeConnection.php file I ended up looking in the changes made in PHP 8.2 and saw that the dynamic properties are deprecated, see https://www.php.net/releases/8.2/en.php#deprecate_dynamic_properties. I decided to add a new class variable private $remote after discussing the new situation with @SimonFrings. Tests are running green now. 👍

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also updated my comment and explain the situation. Thank you @clue for giving me the hint to exclude groups. It was definitely faster for narrowing it down. 👍

@SimonFrings SimonFrings requested review from clue and SimonFrings and removed request for clue April 23, 2024 13:42
@yadaiio yadaiio changed the title Run tests on PHP 8.3 and update test suite Run tests on PHP 8.3, fix dynamic property for PHP 8.2 and update test suite Apr 25, 2024
Copy link
Collaborator

@SimonFrings SimonFrings left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dynamic property seems to be an oversight from #37, thanks for fixing this 👍

@@ -29,7 +29,7 @@ public function setUpConnector()
public function tearDownSSHClientProcess()
{
// run loop in order to shut down SSH client process again
\React\Async\await(\React\Promise\Timer\sleep(0.001));
\React\Async\await(\React\Async\delay(0.001));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Untested, invalid code. delay() returns a void and can't be passed to await(). Also, delay() requires correct Async package version.

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

Successfully merging this pull request may close these issues.

None yet

3 participants