Handle variance in refresh count between ES versions

This commit is contained in:
Paul Bonser 2015-06-24 10:32:01 -05:00
parent 51df70436b
commit 953759da48

View File

@ -799,9 +799,11 @@ func (s *GoesTestSuite) TestIndexStatus(c *C) {
primarySizeInBytes := response.Indices[indexName].Index["primary_size_in_bytes"].(float64) primarySizeInBytes := response.Indices[indexName].Index["primary_size_in_bytes"].(float64)
sizeInBytes := response.Indices[indexName].Index["size_in_bytes"].(float64) sizeInBytes := response.Indices[indexName].Index["size_in_bytes"].(float64)
refreshTotal := response.Indices[indexName].Refresh["total"].(float64)
c.Assert(primarySizeInBytes > 0, Equals, true) c.Assert(primarySizeInBytes > 0, Equals, true)
c.Assert(sizeInBytes > 0, Equals, true) c.Assert(sizeInBytes > 0, Equals, true)
c.Assert(refreshTotal > 0, Equals, true)
expectedIndices := map[string]IndexStatus{ expectedIndices := map[string]IndexStatus{
indexName: { indexName: {
@ -827,7 +829,7 @@ func (s *GoesTestSuite) TestIndexStatus(c *C) {
"total_size_in_bytes": float64(0), "total_size_in_bytes": float64(0),
}, },
Refresh: map[string]interface{}{ Refresh: map[string]interface{}{
"total": float64(1), "total": refreshTotal,
"total_time_in_millis": float64(0), "total_time_in_millis": float64(0),
}, },
Flush: map[string]interface{}{ Flush: map[string]interface{}{