Tests: Add memory info to static bwc index tests.
This commit is contained in:
parent
f95fa83e5b
commit
54d01c48cb
|
@ -126,6 +126,7 @@ public class OldIndexBackwardsCompatibilityTests extends StaticIndexBackwardComp
|
|||
public void testOldIndexes() throws Exception {
|
||||
Collections.shuffle(indexes, getRandom());
|
||||
for (String index : indexes) {
|
||||
logMemoryStats();
|
||||
logger.info("Testing old index " + index);
|
||||
assertOldIndexWorks(index);
|
||||
}
|
||||
|
|
|
@ -86,6 +86,7 @@ import org.elasticsearch.common.util.concurrent.EsRejectedExecutionException;
|
|||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.common.xcontent.XContentFactory;
|
||||
import org.elasticsearch.common.xcontent.XContentHelper;
|
||||
import org.elasticsearch.common.xcontent.json.JsonXContent;
|
||||
import org.elasticsearch.common.xcontent.support.XContentMapValues;
|
||||
import org.elasticsearch.discovery.zen.elect.ElectMasterService;
|
||||
|
@ -1091,6 +1092,13 @@ public abstract class ElasticsearchIntegrationTest extends ElasticsearchTestCase
|
|||
segsRsp.toXContent(JsonXContent.contentBuilder().prettyPrint(), ToXContent.EMPTY_PARAMS).string());
|
||||
}
|
||||
|
||||
/**
|
||||
* Prints current memory stats as info logging.
|
||||
*/
|
||||
public void logMemoryStats() {
|
||||
logger.info("memory: {}", XContentHelper.toString(client().admin().cluster().prepareNodesStats().clear().setJvm(true).get()));
|
||||
}
|
||||
|
||||
void ensureClusterSizeConsistency() {
|
||||
if (cluster() != null) { // if static init fails the cluster can be null
|
||||
logger.trace("Check consistency for [{}] nodes", cluster().size());
|
||||
|
|
Loading…
Reference in New Issue