Fixing org.opensearch.monitor.os.OsProbeTests::testLogWarnCpuMessageOnlyOnes when CGroups are not available (#2101)

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
This commit is contained in:
Andriy Redko 2022-02-14 12:10:16 -05:00 committed by GitHub
parent 27ed6fc82c
commit a942b275ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -41,6 +41,7 @@ import static org.hamcrest.Matchers.greaterThanOrEqualTo;
import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.lessThanOrEqualTo; import static org.hamcrest.Matchers.lessThanOrEqualTo;
import static org.hamcrest.Matchers.notNullValue; import static org.hamcrest.Matchers.notNullValue;
import static org.junit.Assume.assumeThat;
import java.io.IOException; import java.io.IOException;
import java.math.BigInteger; import java.math.BigInteger;
@ -295,6 +296,7 @@ public class OsProbeTests extends OpenSearchTestCase {
} }
}; };
assumeThat("CGroups are not available", noCpuStatsOsProbe.areCgroupStatsAvailable(), is(true));
noCpuStatsOsProbe.osStats(); noCpuStatsOsProbe.osStats();
// no nr_throttled and throttled_time // no nr_throttled and throttled_time
verify(logger, times(2)).warn(anyString()); verify(logger, times(2)).warn(anyString());