Skip to content

Conversation

ihor-sviziev
Copy link
Contributor

@ihor-sviziev ihor-sviziev commented Oct 22, 2021

Skip the test in case of the following error:
Warning: pcntl_fork(): Error 12

This happened when there was not enough memory to fork:
https://stackoverflow.com/q/2420606/1839611

Description (*)

Pre-history: quote often on PRs were failing unit tests with the following error:

...
Time: 01:01.018, Memory: 2.41 GB

There were 6 failures:

1) Magento\Indexer\Test\Unit\Model\ProcessManagerTest::testFailureInChildProcessHandleMultiThread with data set "more_threads_than_functions" (array(Closure Object (...), Closure Object (...), Closure Object (...)), 4)
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'Fail in child process'
+'Warning: pcntl_fork(): Error 12 in /var/www/html/app/code/Magento/Indexer/Model/ProcessManager.php:105.'

/var/www/html/app/code/Magento/Indexer/Test/Unit/Model/ProcessManagerTest.php:38

2) Magento\Indexer\Test\Unit\Model\ProcessManagerTest::testFailureInChildProcessHandleMultiThread with data set "less_threads_than_functions" (array(Closure Object (...), Closure Object (...), Closure Object (...)), 2)
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'Fail in child process'
+'Warning: pcntl_fork(): Error 12 in /var/www/html/app/code/Magento/Indexer/Model/ProcessManager.php:105.'

/var/www/html/app/code/Magento/Indexer/Test/Unit/Model/ProcessManagerTest.php:38

3) Magento\Indexer\Test\Unit\Model\ProcessManagerTest::testFailureInChildProcessHandleMultiThread with data set "equal_threads_and_functions" (array(Closure Object (...), Closure Object (...), Closure Object (...)), 3)
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'Fail in child process'
+'Warning: pcntl_fork(): Error 12 in /var/www/html/app/code/Magento/Indexer/Model/ProcessManager.php:105.'

/var/www/html/app/code/Magento/Indexer/Test/Unit/Model/ProcessManagerTest.php:38

4) Magento\Indexer\Test\Unit\Model\ProcessManagerTest::testSuccessChildProcessHandleMultiThread with data set "more_threads_than_functions" (array(Closure Object (...), Closure Object (...), Closure Object (...)), 4)
Exception was not handled

/var/www/html/app/code/Magento/Indexer/Test/Unit/Model/ProcessManagerTest.php:120

5) Magento\Indexer\Test\Unit\Model\ProcessManagerTest::testSuccessChildProcessHandleMultiThread with data set "less_threads_than_functions" (array(Closure Object (...), Closure Object (...), Closure Object (...)), 2)
Exception was not handled

/var/www/html/app/code/Magento/Indexer/Test/Unit/Model/ProcessManagerTest.php:120

6) Magento\Indexer\Test\Unit\Model\ProcessManagerTest::testSuccessChildProcessHandleMultiThread with data set "equal_threads_and_functions" (array(Closure Object (...), Closure Object (...), Closure Object (...)), 3)
Exception was not handled

/var/www/html/app/code/Magento/Indexer/Test/Unit/Model/ProcessManagerTest.php:120

FAILURES!
Tests: 22667, Assertions: 69879, Failures: 6, Skipped: 91, Incomplete: 44.

Example: Last time I saw this issue on #34399
https://public-results-storage-prod.magento-testing-service.engineering/reports/magento/magento2/pull/34399/d53c915bd4e91bdb4df3272d0d7c5a78/Unit/console-error-logs.html

Also #34396
https://public-results-storage-prod.magento-testing-service.engineering/reports/magento/magento2/pull/34396/0ce3b2d64602ea4606ac9211f6f992b7/Unit/console-error-logs.html

Just re-running the unit tests usually helped, but that's a workaround.

Related Pull Requests

Fixed Issues (if relevant)

  1. Fixes magento/magento2#<issue_number>

Manual testing scenarios (*)

  1. ...
  2. ...

Questions or comments

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
  • All automated tests passed successfully (all builds are green)

@m2-assistant
Copy link

m2-assistant bot commented Oct 22, 2021

Hi @ihor-sviziev. Thank you for your contribution
Here are some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

❗ Automated tests can be triggered manually with an appropriate comment:

  • @magento run all tests - run or re-run all required tests against the PR changes
  • @magento run <test-build(s)> - run or re-run specific test build(s)
    For example: @magento run Unit Tests

<test-build(s)> is a comma-separated list of build names. Allowed build names are:

  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE,
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests
  13. Semantic Version Checker

You can find more information about the builds here

ℹ️ Run only required test builds during development. Run all test builds before sending your pull request for review.

For more details, review the Magento Contributor Guide documentation.

⚠️ According to the Magento Contribution requirements, all Pull Requests must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

🕙 You can find the schedule on the Magento Community Calendar page.

📞 The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

@ihor-sviziev
Copy link
Contributor Author

@magento run all tests

@magento-automated-testing
Copy link

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

@ihor-sviziev
Copy link
Contributor Author

@magento run all tests

@magento-automated-testing
Copy link

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

@ihor-sviziev
Copy link
Contributor Author

@andrewbess @sidolov @xmav, I hope you can merge it very soon. This issue happens quite frequently on different PRs.

Skip the test in case of the following error:
Warning: pcntl_fork(): Error 12

This happened when there was not enough memory to fork:
https://stackoverflow.com/q/2420606/1839611
@ihor-sviziev ihor-sviziev force-pushed the fix-ProcessManagerTest-failure branch from ec5d9ea to 9b08194 Compare October 22, 2021 09:51
@ihor-sviziev
Copy link
Contributor Author

@magento run all tests

@magento-automated-testing
Copy link

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

@ihor-sviziev
Copy link
Contributor Author

Right now Unit tests are passing https://github.com/magento/magento2/pull/34408/checks?check_run_id=3974324983
@magento run Unit Tests

@magento-automated-testing
Copy link

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

1 similar comment
@magento-automated-testing
Copy link

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

@ihor-sviziev
Copy link
Contributor Author

Right now Unit tests are passing again https://github.com/magento/magento2/pull/34408/checks?check_run_id=3975098381
image

@magento run Unit Tests

@magento-automated-testing
Copy link

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

@xmav
Copy link
Contributor

xmav commented Oct 22, 2021

Hi @ihor-sviziev! Let's put this PR on hold now. That should be fixed today internally

@m2-assistant
Copy link

m2-assistant bot commented Oct 22, 2021

Hi @ihor-sviziev, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

@ihor-sviziev ihor-sviziev deleted the fix-ProcessManagerTest-failure branch November 1, 2021 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants