[TEST] fixed scriptedMetricTests

The tests were failing because there was a shard which didn't get any documents and the tests assumed all shards had documents. This commit fixes this assumption