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

Some config results in OOM, reduce list of project in config #141

Closed
relentless-pursuit opened this issue Jul 23, 2024 · 11 comments
Closed

Comments

@relentless-pursuit
Copy link
Collaborator

relentless-pursuit commented Jul 23, 2024

While testing regression testing of WhitespaceAround Check, we realised it led to OOM issue. We need to see which projects can be removed to keep it light weight.

Full list at #120 (comment)

@relentless-pursuit
Copy link
Collaborator Author

@romani How to investigate?

@romani
Copy link
Member

romani commented Jul 24, 2024

Just remove projects from list until it pass :).

We generate too much violations, it blows up to generate website.

@romani romani changed the title Invesitgate OOM issue WhitespaceAround WhitespaceAround: results in OOM, reduce list of project in config Sep 8, 2024
@romani
Copy link
Member

romani commented Sep 25, 2024

in referenced PR, they will split config in few, they will probably put jdk in separate config.
so we can do the same and just drop openjdk from list of projects for all-in-one.

relentless-pursuit pushed a commit to relentless-pursuit/test-configs that referenced this issue Sep 26, 2024
relentless-pursuit pushed a commit to relentless-pursuit/test-configs that referenced this issue Sep 26, 2024
relentless-pursuit pushed a commit to relentless-pursuit/test-configs that referenced this issue Sep 27, 2024
@romani romani changed the title WhitespaceAround: results in OOM, reduce list of project in config Some config results in OOM, reduce list of project in config Sep 27, 2024
@romani romani moved this from Todo to In Progress in Tooling for Regression Testing Oct 4, 2024
relentless-pursuit pushed a commit to relentless-pursuit/test-configs that referenced this issue Oct 11, 2024
@romani
Copy link
Member

romani commented Oct 11, 2024

regexp still has problems checkstyle/checkstyle#15578 (comment)

Caused by: org.xml.sax.SAXParseException: The value of attribute "value" associated with an element type "property" must not contain the '<' character.
....
at com.puppycrawl.tools.checkstyle.XmlLoader.parseInputSource (XmlLoader.java:84)
    at com.puppycrawl.tools.checkstyle.ConfigurationLoader.parseInputSource (ConfigurationLoader.java:195)
    at com.puppycrawl.tools.checkstyle.ConfigurationLoader.loadConfiguration (ConfigurationLoader.java:311)
    at com.puppycrawl.tools.checkstyle.ConfigurationLoader.loadConfiguration (ConfigurationLoader.java:262)

Problem is in our config, checkstyle classes failing to load it.

At checkstyle/checkstyle#13345 I see that it is not Enabled, so it means that configs might be broken. It will be good to find mistake and fix Examples in checkstyle repository.

Problem is at:

<module name="Regexp">
            <property name="duplicateLimit" value="0"/>
            <property name="format" value='(/\*\*\n)( \*.*\n)*( \* <P>\n \*   <I>        This software is the confidential and proprietary information of\n        \*   ACME \(<B>"Confidential Information"</B>        \)\. You shall not\n \*   disclose such Confidential Information        and shall use it only in\n \*   accordance with the terms of the        license agreement you entered into\n \*   with ACME\.</I>\n        \* </P>\n \*\n \* © copyright \d\d\d\d ACME\n        \*\n \* @author .*)(\n\s\*.*)*/\n[\w|\s]*( class | interface )'/>
            <property name="id" value="example13"/>
            <property name="message" value="Copyright in class/interface Javadoc"/>
        </module>

Value has <P> , we should try to escape < symbols.
Solution:
https://stackoverflow.com/a/7197215/1015848

Problem should be fixed in checkstyle repository.

@relentless-pursuit
Copy link
Collaborator Author

relentless-pursuit commented Oct 12, 2024

@relentless-pursuit
Copy link
Collaborator Author

For IllegalTokenText and MultipleStringLiterals, we made changes for the configs to be correct in the extractor. Earlier, we noticed there was a difference wrt how configs from main repo of checkstyle and the generated ones had wrt quotes. We saw double quotes being wrapped under value. We made code changes to make it single quotes complying with the examples files in main repo in this PR: #212

@relentless-pursuit
Copy link
Collaborator Author

relentless-pursuit commented Oct 12, 2024

https://github.com/checkstyle-gsoc/checkstyle/actions/runs/11305582825/job/31445261771

Github, generate report for InterfaceMemberImpliedModifier/all-examples-in-one

The results were successful.

Doing a second round of testing in main repo. Runner: https://github.com/checkstyle/checkstyle/actions/runs/11305872027

UPDATE:
InterfaceMemberImpliedModifier is working fine. Striking it off.

@relentless-pursuit
Copy link
Collaborator Author

relentless-pursuit commented Oct 12, 2024

https://github.com/checkstyle-gsoc/checkstyle/actions/runs/11305891527

Github, generate report for NeedBraces/all-examples-in-one

The results were successful.

Doing a second round of testing in main repo. Runner: https://github.com/checkstyle/checkstyle/actions/runs/11306157786

UPDATE:
NeedBraces is working fine. Striking it off.

@relentless-pursuit
Copy link
Collaborator Author

relentless-pursuit commented Oct 12, 2024

For TrailingComment,
https://github.com/checkstyle-gsoc/checkstyle/actions/runs/11309536077/job/31453494011

Despite deleting the project list of openjdk21, checkstyle-sonar my the execution is stuck.
@romani, i am not being able to figure out the reason as the logs don't say anything.

Possibly, example3 and 4 are causing issues.

      <module name="TrailingComment">
           <property name="id" value="example3"/>
       </module>

       <module name="SuppressionXpathSingleFilter">
           <property name="checks" value="TrailingCommentCheck"/>
           <property name="id" value="example3"/>
           <property name="query" value="//SINGLE_LINE_COMMENT        [./COMMENT_CONTENT[@text=' NOSONAR\n' or @text=' NOPMD\n'        or @text=' SUPPRESS CHECKSTYLE\n']]"/>
       </module>

       <module name="TrailingComment">
           <property name="id" value="example4"/>
       </module>

       <module name="SuppressionXpathSingleFilter">
           <property name="checks" value="TrailingCommentCheck"/>
           <property name="id" value="example4"/>
           <property name="query" value="//SINGLE_LINE_COMMENT        [./COMMENT_CONTENT[starts-with(@text, ' NOPMD')]],//SINGLE_LINE_COMMENT        [./COMMENT_CONTENT[starts-with(@text, ' SUPPRESS CHECKSTYLE')]],//SINGLE_LINE_COMMENT        [./COMMENT_CONTENT[starts-with(@text, ' NOSONAR')]]"/>
       </module>

@relentless-pursuit
Copy link
Collaborator Author

For regex, we had to create a PR to make sure generated configs are i sync with actual xml configs in example files.

Test run: https://github.com/checkstyle/checkstyle/actions/runs/11310865938

@romani
Copy link
Member

romani commented Oct 15, 2024

TrailingComments is fixed by #216 , #217

@romani romani closed this as completed Oct 15, 2024
@github-project-automation github-project-automation bot moved this from In Progress to Done in Tooling for Regression Testing Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

No branches or pull requests

2 participants