-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Fix AcountManagementTest unit test fail randomly #11605
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
Merged
magento-team
merged 1 commit into
magento:2.3-develop
from
adrian-martinez-interactiv4:FR#ACCOUNTMANAGEMENTTEST-RANDOM-FAIL
Oct 30, 2017
Merged
Fix AcountManagementTest unit test fail randomly #11605
magento-team
merged 1 commit into
magento:2.3-develop
from
adrian-martinez-interactiv4:FR#ACCOUNTMANAGEMENTTEST-RANDOM-FAIL
Oct 30, 2017
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cfbac35
to
11a4eee
Compare
orlangur
requested changes
Oct 27, 2017
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bamboo said:
LiveCodeTest testCodeMess History
1 sec
Magento\Test\Php\LiveCodeTest::testCodeMess
PHP Code Mess has found error(s):
/opt/bamboo/bamboo-agent-home/xml-data/build-dir/M2-AT2593-SLE1/magento2/app/code/Magento/Customer/Test/Unit/Model/AccountManagementTest.php:1609 Avoid unused local variables such as '$datetime'.
Failed asserting that 2 matches expected 0.
/opt/bamboo/bamboo-agent-home/xml-data/build-dir/M2-AT2593-SLE1/magento2/dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php:237
Failed LiveCodeTest testCodeStyle History
< 1 sec
Magento\Test\Php\LiveCodeTest::testCodeStyle
PHP Code Sniffer detected 2 violation(s):
FILE: ...1/magento2/app/code/Magento/Customer/Model/AccountManagement.php
----------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
----------------------------------------------------------------------
901 | ERROR | [x] Multi-line function call not indented correctly;
(16 more lines...)
@orlangur Yep, I know, I'm on it |
11a4eee
to
43230e7
Compare
43230e7
to
b158dcf
Compare
@orlangur Tests passed |
magento-team
pushed a commit
that referenced
this pull request
Oct 30, 2017
magento-team
pushed a commit
that referenced
this pull request
Oct 30, 2017
[EngCom] Public Pull Requests - develop - MAGETWO-82942: Send email to subscribers only when are new #11604 - MAGETWO-82752: Fixes translations by re-running the loadData for its correct locale #10913 - MAGETWO-82460: Fix AcountManagementTest unit test fail randomly #11605 - MAGETWO-82070: Update knockout #11269
4 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Surprisingly, after testing succesfully locally unit tests, I've found this error in Travis, in unit tests performed by \Magento\Customer\Test\Unit\Model\AccountManagementTest class:

Simply rebuilding the job worked and all the tests passed, but this error may happen again at any time, due to how are mocks built in that class:
Removing expected date fix this rare, weird, but actually happening, issue.
Manual testing scenarios
$dateTime = date(\Magento\Framework\Stdlib\DateTime::DATETIME_PHP_FORMAT);
to
$dateTime = '2017-10-20 00:00:00';
in \Magento\Customer\Test\Unit\Model\AccountManagementTest::prepareInitiatePasswordReset method.
Contribution checklist