The test getSwap in OsProbeTests shouldn't fail on a machine with no swap

In some cases the swap size can be reported as 0.
This commit is contained in:
Igor Motov 2015-07-08 13:34:38 -04:00
parent d7af88631f
commit 0187508f70
1 changed files with 2 additions and 2 deletions

View File

@ -56,8 +56,8 @@ public class OsProbeTests extends ElasticsearchTestCase {
assertThat(stats.getMem().getUsedPercent(), allOf(greaterThanOrEqualTo((short) 0), lessThanOrEqualTo((short) 100)));
assertNotNull(stats.getSwap());
assertThat(stats.getSwap().getTotal().bytes(), anyOf(equalTo(-1L), greaterThan(0L)));
assertThat(stats.getSwap().getFree().bytes(), anyOf(equalTo(-1L), greaterThan(0L)));
assertThat(stats.getSwap().getTotal().bytes(), anyOf(equalTo(-1L), greaterThanOrEqualTo(0L)));
assertThat(stats.getSwap().getFree().bytes(), anyOf(equalTo(-1L), greaterThanOrEqualTo(0L)));
assertThat(stats.getSwap().getUsed().bytes(), anyOf(equalTo(-1L), greaterThanOrEqualTo(0L)));
}
}