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

Magento#25669: fixed issue "health_check.php fails if any database cache engine configured" #25722

Merged
merged 4 commits into from
Mar 15, 2020

Conversation

andrewbess
Copy link

Description (*)

This PR fixes the issue /issues/25669: health_check.php fails if any database cache engine configured.

Fixed Issues (if relevant)

  1. health_check.php fails if any database cache engine configured #25669: health_check.php fails if any database cache engine configured

Manual testing scenarios (*)

  1. Create custom cache engine like it described in devdocs
  2. Configure any cache to database in env.php (for example look at Configuration examples)
  3. Run ./bin/magento setup:di:compile and wait finishing
  4. Run health_check.php

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)
  • All automated tests passed successfully (all builds are green)

…nfigured

- fixed wrong "@return description" of the remove method in class
  Magento\Framework\Cache\Backend\Database
- fixed wrong returned type of the method "unlock" in class
  Magento\Framework\Lock\Backend\Cache
- fixed health_check to create instances into block "check cache storage
  availability"
@m2-assistant
Copy link

m2-assistant bot commented Nov 24, 2019

Hi @andrewbess. Thank you for your contribution
Here is 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.3-develop instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Guide documentation.

@magento-engcom-team magento-engcom-team added Component: Cache Component: Lock Release Line: 2.3 Partner: Atwix Pull Request is created by partner Atwix partners-contribution Pull Request is created by Magento Partner labels Nov 24, 2019
…nfigured

- fixed PHPDocs according to requirements static tests for CE
@andrewbess
Copy link
Author

https://prnt.sc/q1rujl
It was removing wrong commit where I pulled changes from 2.3-develop into issue-25669.

@rogyar rogyar self-assigned this Dec 4, 2019
pub/health_check.php Show resolved Hide resolved
@@ -45,7 +45,7 @@ public function lock(string $name, int $timeout = -1): bool
*/
public function unlock(string $name): bool
{
return $this->cache->remove($this->getIdentifier($name));
return (bool)$this->cache->remove($this->getIdentifier($name));
Copy link
Contributor

Choose a reason for hiding this comment

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

Could I kindly ask you to cover this part using a simple unit test? Just mock a behavior that caused an error previously for $this->cache->remove($this->getIdentifier($name)) and make sure that there's no error after the proposed change.

Thank you!

Copy link
Author

Choose a reason for hiding this comment

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

Hello @rogyar
Tests have already created.
Thank you @engcom-Echo

@rogyar rogyar added Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests Progress: needs update and removed Progress: needs update labels Dec 4, 2019
@sidolov sidolov changed the base branch from 2.3-develop to 2.4-develop December 5, 2019 17:12
@engcom-Echo
Copy link
Contributor

I will take care of test coverage.

@engcom-Echo engcom-Echo added Auto-Tests: Covered All changes in Pull Request is covered by auto-tests and removed Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests labels Feb 4, 2020
@magento-engcom-team
Copy link
Contributor

Hi @rogyar, thank you for the review.
ENGCOM-6834 has been created to process this Pull Request

@engcom-Echo
Copy link
Contributor

✔️ QA passed

@m2-assistant
Copy link

m2-assistant bot commented Mar 15, 2020

Hi @andrewbess, 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.

@andrewbess andrewbess deleted the issue-25669 branch October 28, 2020 09:58
@sdzhepa sdzhepa mentioned this pull request May 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Tests: Covered All changes in Pull Request is covered by auto-tests Award: bug fix Award: category of expertise Component: Cache Component: Lock Partner: Atwix Pull Request is created by partner Atwix partners-contribution Pull Request is created by Magento Partner Progress: accept Release Line: 2.4
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants