Skip to content

Conversation

MarcelBolten
Copy link
Contributor

This could potentially close #6709 but on the other hand it might result in truncated reports again. This would happen if the accumulated runtime of the registered shutdown functions in c3.php exceeds 10 * 0.25 = 2.5 sec which seems possible.
Maybe a bigger value for retries is necessary.

@Naktibalda
Copy link
Member

I have no idea if 2.5s is enough, but it is quite low, raising it to 10s should be fine.
Maybe even to 30s, but if it happens every time, then it is an indication that your file locking is not working as expected.

Have you got any idea what's causing infinite loop?

@MarcelBolten
Copy link
Contributor Author

MarcelBolten commented Nov 27, 2023

It runs fine for our tests at https://github.com/elabftw/elabftw, no infinite loops.

However, I tried to enable path coverage and ran out of memory during (un)serializing in the registered shutdown function in c3.php. In this case, there was an infinite loop because the shutdown function did not finish, resulting in "unfinished" tests. Hence, blocked reports.

I would argue that in this case, it is good to realize there is a problem. Even when it is not caused by the code that is tested.

@Naktibalda
Copy link
Member

@MarcelBolten Your pull requests are marked as Draft.

Do you want me to merge and release them?

@MarcelBolten
Copy link
Contributor Author

Let me change $retries so the loop runs for 30s.
I will push it later today.

@MarcelBolten
Copy link
Contributor Author

Wait period is set to 30s ($retries = 120;).
Also, a Notification::warning() is added and will be shown when 30s are reached.
tests/data/claypit/c3.php is updated to version 2.9.0

@MarcelBolten MarcelBolten marked this pull request as ready for review November 29, 2023 07:11
usleep(250_000); // 0.25 sec
}
if (file_get_contents($blockfilename) !== '0' && $retries === -1) {
Notification::warning(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe a RuntimeException() should/could be thrown.

@Naktibalda Naktibalda merged commit a8a1584 into Codeception:5.0 Dec 1, 2023
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

Successfully merging this pull request may close these issues.

Code coverage stopped working after upgrading 4 to 5
2 participants