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

Tests no memory limit #16314

Merged
merged 2 commits into from Aug 23, 2020
Merged

Tests no memory limit #16314

merged 2 commits into from Aug 23, 2020

Conversation

Findus23
Copy link
Member

While testing around with php8, I stumbled across 7960333 which is a test that tries to force a PHP Fatal error: Allowed memory size of X bytes exhausted on php-cli.

Unfortunately, on my system (and probably others too) php-cli has a memory_limit of -1 which means the PC will run out of memory before one can notice what command is running.

This PR adds a slight hack to skip this test in this case.

@Findus23 Findus23 added c: Tests & QA For issues related to automated tests or making it easier to QA & test issues. Needs Review PRs that need a code review labels Aug 17, 2020
@@ -145,6 +145,16 @@ public function test_Console_ReturnsCorrectExitCode_IfCommandDoesNotEmitAnything

public function test_Console_handlesFatalErrorsCorrectly()
{
$cliPhp = new CliPhp();
Copy link
Member

Choose a reason for hiding this comment

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

@Findus23 I suppose ini_get('memory_limit'); didn't work there?

Copy link
Member Author

Choose a reason for hiding this comment

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

It doesn't as this is not calling the current PHP binary, but a separate php binary picked by $cliPhp->findPhpBinary which doesn't have to be the same (in my case it crashed the PC the first few times because I didn't notice that it was calling php7.4 while I was running the tests with php8). Therefore, I am checking the memory limit of the php binary that will be called in the test.

@tsteur tsteur merged commit 61c2774 into 4.x-dev Aug 23, 2020
@tsteur tsteur deleted the tests-no-memory-limit branch August 23, 2020 22:01
@mattab mattab added this to the 4.0.0 milestone Sep 10, 2020
@mattab mattab added the not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. label Sep 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: Tests & QA For issues related to automated tests or making it easier to QA & test issues. Needs Review PRs that need a code review not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants