Skip to content

Fixing org.opensearch.monitor.os.OsProbeTests::testLogWarnCpuMessageOlyOnes when CGroups are not available #2101

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

Conversation

reta
Copy link
Contributor

@reta reta commented Feb 14, 2022

Signed-off-by: Andriy Redko [email protected]

Description

The newly added org.opensearch.monitor.os.OsProbeTests::testLogWarnCpuMessageOlyOnes test case always assumes that CGroups are available but this may not be the case. The test fails otherwise:

org.opensearch.monitor.os.OsProbeTests > testLogWarnCpuMessageOnlyOnes FAILED                                                                                                                                                                                                                                                                                                               
    Wanted but not invoked:                                                                                                                                                                                                                                                                                                                                                                 
    logger.warn(<any string>);                                                                                                                                                                                                                                                                                                                                                              
    -> at org.opensearch.monitor.os.OsProbeTests.testLogWarnCpuMessageOnlyOnes(OsProbeTests.java:300)                                                                                                                                                                                                                                                                                       
    Actually, there were zero interactions with this mock.                                                                                                                                                                                                                                                                                                                                  
        at __randomizedtesting.SeedInfo.seed([98F51BCCE98CC711:506380649692FF1F]:0)                                                                                                                                                                                                                                                                                                         
        at app//org.opensearch.monitor.os.OsProbeTests.testLogWarnCpuMessageOnlyOnes(OsProbeTests.java:300) 

Issues Resolved

N/A

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

…nlyOnes when CGroups are not available

Signed-off-by: Andriy Redko <[email protected]>
@reta reta requested a review from a team as a code owner February 14, 2022 15:22
@opensearch-ci-bot
Copy link
Collaborator

Can one of the admins verify this patch?

@willyborankin
Copy link
Contributor

willyborankin commented Feb 14, 2022

Ahhh true. Not all distros and OS wanna have cgorups. thnx

@opensearch-ci-bot
Copy link
Collaborator

✅   Gradle Check success 00193fc
Log 2376

Reports 2376

Copy link
Member

@dblock dblock left a comment

Choose a reason for hiding this comment

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

For my education, what platform were you able to reproduce this on?

@dblock dblock merged commit a942b27 into opensearch-project:main Feb 14, 2022
opensearch-trigger-bot bot pushed a commit that referenced this pull request Feb 14, 2022
…nlyOnes when CGroups are not available (#2101)

Signed-off-by: Andriy Redko <[email protected]>
(cherry picked from commit a942b27)
@reta
Copy link
Contributor Author

reta commented Feb 14, 2022

For my education, what platform were you able to reproduce this on?

Mine is Ubuntu 21.10, but Windows will fail as well

dblock pushed a commit that referenced this pull request Mar 23, 2022
…nlyOnes when CGroups are not available (#2101) (#2102)

Signed-off-by: Andriy Redko <[email protected]>
(cherry picked from commit a942b27)

Co-authored-by: Andriy Redko <[email protected]>
reta added a commit to reta/OpenSearch that referenced this pull request May 24, 2022
…nlyOnes when CGroups are not available (opensearch-project#2101)

Signed-off-by: Andriy Redko <[email protected]>
reta added a commit that referenced this pull request May 25, 2022
…nlyOnes when CGroups are not available (#2101) (#3433)

Signed-off-by: Andriy Redko <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants