From 494ad0d5720e7f2893ad87b58a110e1b3571d113 Mon Sep 17 00:00:00 2001 From: Ali Beyad Date: Mon, 12 Sep 2016 19:47:20 -0400 Subject: [PATCH] [TESTS] for the REST cluster stats test, if free or used (#20434) memory are much less than the total memory, the percentage returned could be 0%. The yaml tests check that the free/used percentage are valid values by asserting `is_true`, but it turns out that `is_true` returns false if the value is assigned but it is 0 or even the string "0". This commit changes the assertion in the yaml test to ensure the value is greater than or equal to 0 instead. --- .../resources/rest-api-spec/test/cluster.stats/10_basic.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/cluster.stats/10_basic.yaml b/rest-api-spec/src/main/resources/rest-api-spec/test/cluster.stats/10_basic.yaml index ccbfc199cec..29f048068b4 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/cluster.stats/10_basic.yaml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/cluster.stats/10_basic.yaml @@ -22,8 +22,8 @@ - is_true: nodes.os.mem.total_in_bytes - is_true: nodes.os.mem.free_in_bytes - is_true: nodes.os.mem.used_in_bytes - - is_true: nodes.os.mem.free_percent - - is_true: nodes.os.mem.used_percent + - gte: { nodes.os.mem.free_percent: 0 } + - gte: { nodes.os.mem.used_percent: 0 } - is_true: nodes.process - is_true: nodes.jvm - is_true: nodes.fs