Skip to content

Commit a444079

Browse files
retagithub-actions[bot]
authored andcommitted
Fixing org.opensearch.monitor.os.OsProbeTests::testLogWarnCpuMessageOnlyOnes when CGroups are not available (#2101)
Signed-off-by: Andriy Redko <[email protected]> (cherry picked from commit a942b27)
1 parent 55eb372 commit a444079

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

server/src/test/java/org/opensearch/monitor/os/OsProbeTests.java

+2
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
import static org.hamcrest.Matchers.is;
4242
import static org.hamcrest.Matchers.lessThanOrEqualTo;
4343
import static org.hamcrest.Matchers.notNullValue;
44+
import static org.junit.Assume.assumeThat;
4445

4546
import java.io.IOException;
4647
import java.math.BigInteger;
@@ -295,6 +296,7 @@ List<String> readSysFsCgroupCpuAcctCpuStat(String controlGroup) throws IOExcepti
295296
}
296297
};
297298

299+
assumeThat("CGroups are not available", noCpuStatsOsProbe.areCgroupStatsAvailable(), is(true));
298300
noCpuStatsOsProbe.osStats();
299301
// no nr_throttled and throttled_time
300302
verify(logger, times(2)).warn(anyString());

0 commit comments

Comments
 (0)