-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Let background commands actually run in the background #37511
Let background commands actually run in the background #37511
Conversation
Hi @fredden. Thank you for your contribution! Add the comment under your pull request to deploy test or vanilla Magento instance:
❗ Automated tests can be triggered manually with an appropriate comment:
Allowed build names are:
You can find more information about the builds here For more details, review the Code Contributions documentation. |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues. |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues. |
4 similar comments
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues. |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues. |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues. |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues. |
@engcom-Hotel / @engcom-Charlie, given this has been mentioned several times in #32690, and the automated testing suite is passing 100% here, please can you look to get this reviewed/merged to avoid further delays in #32690? |
@engcom-Charlie thanks very much for taking the time to discuss this and #32690 with me today. I've updated the "manual testing" steps in this pull request as discussed. I will try to get the Magento Functional Testing Framework set up to run at my end to verify that these steps are sufficient to clearly show that the test is broken on the |
@engcom-Charlie I've worked out why you were not seeing the expected failure of this test in To reliably reproduce the bug this pull request is solving, we need to redirect STDERR here:
eg, : str_replace('2>&1', '2>/dev/null >/dev/null &', $command);
The changes introduced in #32690 include redirecting STDERR as well as STDOUT, which is why we can see the race condition here in that pull request. Edit: I've repurposed this pull request to fix that bug (background processes aren't run in the background), and we can fix the (already) broken tests which this bug-fix highlights in scope of this pull request. |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues. |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues. |
Many of the test failures here will be fixed by magento/magento2-functional-testing-framework#904 |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues. |
HI @fredden, Thank you for the updated Manual testing scenario. ✔️ QA Passed Before: ✖️ After: ✔️ As the build is green so moving it to Merge in Progress. Thank you! |
@magento create issue |
It seems that bot moved it to testing hence moving it back to its previous status, Merge in Progress. |
@magento run Semantic Version Checker |
e444de6
into
magento:2.4-develop
Update 2023-05-30
After discussion with @engcom-Charlie (thanks!), I set up the Magento Functional Testing Framework locally to investigate the specifics of this test. The report was that the test worked fine on the
2.4-develop
branch, but was failing on #32690, so it was suggested that the changes there were breaking this test, and that the test was fine as-is on2.4-develop
. I thought this was a race condition, but it seems it's more complicated than a simple race condition.The reason the test isn't failing on
2.4-develop
is because STDERR isn't being redirected for the child processes, so the testing framework wasn't actually generating background processes when it should have been. 7d56fe4 fixes that bug, which will mean that all other unreliable tests will now be failing here. Many of the test failures here will be fixed by magento/magento2-functional-testing-framework#904Description
While working on #32690 (comment), it was discovered that the test
StorefrontVerifyProductAfterPartialReindexOnSeveralWebsitesTest
(fromMagento\AcceptanceTest\_default\Backend\StorefrontVerifyProductAfterPartialReindexOnSeveralWebsitesTest
) is unreliable. This pull request aims to improve the reliability of this test. While this is not a complete fix, it will improve the reliability.Why is the test unreliable?
The test aims to ensure that indexers are correctly triggered / rebuilt when making changes in the admin. The general process goes: log into admin, make a change, run cron, witness result. It's the "run cron" step that is causing issues. The internals of that step spawns separate processes, and then returns. These separate processes will run in the background and will work, however there is a race condition between these background processes running to completion and the next step of the test being carried out. When the indexer process is quick, all is well. When the test framework gets to the next step before the background process complete, the test fails.
How does this change help?
This pull request turns the background process into a foreground process, so the test framework won't ever reach the next step until the "background" process finishes.
Why is this change incomplete?
There is no guarantee that a job has actually been scheduled. There is still an expectation that there is a
indexer_update_all_views
job in the queue, ready to be executed. Usually this will be the case, however it's not guaranteed. Further test improvements are welcome in this area.Manual testing scenarios
Run the following PHP script. It should report success.
Contribution checklist
Resolved issues: