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

minor: solved pitest issues with ImportOrderCheck #6424

Merged
merged 1 commit into from Feb 15, 2019

Conversation

Projects
None yet
2 participants
@rnveach
Copy link
Member

rnveach commented Feb 14, 2019

After examining issues at #6421 (comment) ,

I looked into this memory and noticed ImportOrderCheck was using like 8 gigs of memory and 25 minutes to complete pitest. When looking at the report only 1 line said memory error. I changed the code around this mutation and now it completes the 1 check under a minute with no excess memory usage. Test was removed because code changed was directly connected to it.

I don't know if this fixes random issue we have seen in CI. It could be related since probably not all CIs will have huge chunks of memory for usage.

As a side note, this also helps solve #3567 as that test was still waiting further review.

@rnveach

This comment has been minimized.

Copy link
Member Author

rnveach commented Feb 14, 2019

Let me know if you want me to assign this to issue I mentioned in first post or you want this to reference the PR itself.

@rnveach rnveach requested a review from romani Feb 14, 2019

@rnveach rnveach force-pushed the rnveach:pitest_importorder_issue branch from 9fa0b55 to 21e802f Feb 14, 2019

Show resolved Hide resolved .ci/pitest.sh Outdated
@rnveach

This comment has been minimized.

Copy link
Member Author

rnveach commented Feb 14, 2019

from logs Total time: 22:28 min, that is not good for sure.

Time dropped now by 20 minutes.

[INFO] Total time: 02:26 min

@rnveach

This comment has been minimized.

Copy link
Member Author

rnveach commented Feb 14, 2019

I tried testing something out by just removing the powermock and leaving the IllegalStateException in the code and it also reduced the testing time. It seems somehow powermock is responsible for the long time and excess memory. I'm not sure if this is an issue in other tests or somehow this check had something unique about it. I also tried leaving powermock in but removing the powermock test, it still took 27 minutes to finish.

Do we want to keep the IllegalStateException but rewrite the test?

@rnveach rnveach force-pushed the rnveach:pitest_importorder_issue branch from 21e802f to a8bd568 Feb 15, 2019

rnveach added a commit to rnveach/checkstyle that referenced this pull request Feb 15, 2019

Whitebox.setInternalState(importOrderOptionMock, "name", "NEW_OPTION_FOR_UT");
Whitebox.setInternalState(importOrderOptionMock, "ordinal", 5);
Whitebox.setInternalState(mock, "option", importOrderOptionMock);
TestUtil.getClassDeclaredField(ImportOrderCheck.class, "option").set(mock, null);

This comment has been minimized.

@rnveach

rnveach Feb 15, 2019

Author Member

IllegalStateException still occurs if we pass option in as null.

This comment has been minimized.

@romani

romani Feb 15, 2019

Member

please put a comment above to explain reflection usage, we agreed some time ago that we will do this.

If you additionally remove @Test(expected = IllegalStateException.class) ... it would be awesome ... I thought we already fobid it by some check..... but if you do not want ... we can postpone this.

@romani

romani approved these changes Feb 15, 2019

Copy link
Member

romani left a comment

approve.

minor:

Whitebox.setInternalState(importOrderOptionMock, "name", "NEW_OPTION_FOR_UT");
Whitebox.setInternalState(importOrderOptionMock, "ordinal", 5);
Whitebox.setInternalState(mock, "option", importOrderOptionMock);
TestUtil.getClassDeclaredField(ImportOrderCheck.class, "option").set(mock, null);

This comment has been minimized.

@romani

romani Feb 15, 2019

Member

please put a comment above to explain reflection usage, we agreed some time ago that we will do this.

If you additionally remove @Test(expected = IllegalStateException.class) ... it would be awesome ... I thought we already fobid it by some check..... but if you do not want ... we can postpone this.

@romani romani assigned rnveach and unassigned romani Feb 15, 2019

@rnveach

This comment has been minimized.

Copy link
Member Author

rnveach commented Feb 15, 2019

I thought we already fobid it by some check..... but if you do not want ... we can postpone this.

@romani See #3567
You wanted to review this item as you didn't like how I removed it before. This is why it still remains.

@rnveach rnveach force-pushed the rnveach:pitest_importorder_issue branch from a8bd568 to 1ebd766 Feb 15, 2019

@rnveach

This comment has been minimized.

Copy link
Member Author

rnveach commented Feb 15, 2019

please put a comment above to explain reflection usage

Done.

@rnveach rnveach assigned romani and unassigned rnveach Feb 15, 2019

@rnveach rnveach merged commit d5e6444 into checkstyle:master Feb 15, 2019

17 checks passed

IDEA Inspections Pull Request (Checkstyle) TeamCity build finished
Details
Shippable Run 8727 status is SUCCESS.
Details
ci/circleci: build-caches Your tests passed on CircleCI!
Details
ci/circleci: pitest1 Your tests passed on CircleCI!
Details
ci/circleci: pitest2 Your tests passed on CircleCI!
Details
ci/circleci: pitest3 Your tests passed on CircleCI!
Details
ci/circleci: pitest4 Your tests passed on CircleCI!
Details
ci/circleci: pitest5 Your tests passed on CircleCI!
Details
ci/circleci: pitest6 Your tests passed on CircleCI!
Details
ci/circleci: pitest8 Your tests passed on CircleCI!
Details
codecov/patch Coverage not affected when comparing 705e0f6...1ebd766
Details
codecov/project 100% remains the same compared to 705e0f6
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
jenkins Build succeeded
Details
security/snyk - pom.xml (romani) No new issues
Details
wercker/build Wercker pipeline passed
Details

@rnveach rnveach deleted the rnveach:pitest_importorder_issue branch Feb 15, 2019

@rnveach rnveach added this to the 8.18 milestone Feb 15, 2019

@rnveach rnveach referenced this pull request Feb 19, 2019

Closed

Remove powermock #6439

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.