Test: add ensure green to indices.stats/12_level.yaml

Also changed the stash logger to not log all stashed values under debug (it does trace now) but do dump the stash content upon failure (under info as a XContent)
This commit is contained in:
Boaz Leskes 2015-04-22 15:40:16 +02:00
parent 6f1b398b33
commit 91ff3f6963
3 changed files with 19 additions and 19 deletions

View File

@ -15,6 +15,10 @@ setup:
id: 1
body: { "foo": "baz" }
- do:
cluster.health:
wait_for_status: green
---
"Level - blank":
- do:

View File

@ -25,7 +25,6 @@ import com.carrotsearch.randomizedtesting.annotations.ParametersFactory;
import com.carrotsearch.randomizedtesting.annotations.TestGroup;
import com.carrotsearch.randomizedtesting.annotations.TimeoutSuite;
import com.google.common.collect.Lists;
import org.apache.lucene.util.LuceneTestCase.Slow;
import org.apache.lucene.util.LuceneTestCase.SuppressCodecs;
import org.apache.lucene.util.LuceneTestCase.SuppressFsync;
@ -40,11 +39,7 @@ import org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope;
import org.elasticsearch.test.rest.client.RestException;
import org.elasticsearch.test.rest.parser.RestTestParseException;
import org.elasticsearch.test.rest.parser.RestTestSuiteParser;
import org.elasticsearch.test.rest.section.DoSection;
import org.elasticsearch.test.rest.section.ExecutableSection;
import org.elasticsearch.test.rest.section.RestTestSuite;
import org.elasticsearch.test.rest.section.SkipSection;
import org.elasticsearch.test.rest.section.TestSection;
import org.elasticsearch.test.rest.section.*;
import org.elasticsearch.test.rest.spec.RestApi;
import org.elasticsearch.test.rest.spec.RestSpec;
import org.elasticsearch.test.rest.support.FileUtils;
@ -54,18 +49,10 @@ import org.junit.BeforeClass;
import org.junit.Test;
import java.io.IOException;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.lang.annotation.*;
import java.nio.file.Path;
import java.nio.file.PathMatcher;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.*;
/**
* Runs the clients test suite against an elasticsearch cluster.
@ -135,7 +122,7 @@ public abstract class ElasticsearchRestTestCase extends ElasticsearchIntegration
blacklistPathMatchers = new PathMatcher[0];
}
}
@Override
protected Settings nodeSettings(int nodeOrdinal) {
return ImmutableSettings.builder()

View File

@ -23,7 +23,10 @@ import com.google.common.collect.Maps;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.logging.ESLogger;
import org.elasticsearch.common.logging.Loggers;
import org.elasticsearch.common.xcontent.ToXContent;
import org.elasticsearch.common.xcontent.XContentBuilder;
import java.io.IOException;
import java.util.List;
import java.util.Map;
@ -31,7 +34,7 @@ import java.util.Map;
* Allows to cache the last obtained test response and or part of it within variables
* that can be used as input values in following requests and assertions.
*/
public class Stash {
public class Stash implements ToXContent {
private static final ESLogger logger = Loggers.getLogger(Stash.class);
@ -43,7 +46,7 @@ public class Stash {
* Allows to saved a specific field in the stash as key-value pair
*/
public void stashValue(String key, Object value) {
logger.debug("stashing [{}]=[{}]", key, value);
logger.trace("stashing [{}]=[{}]", key, value);
Object old = stash.put(key, value);
if (old != null && old != value) {
logger.trace("replaced stashed value [{}] with same key [{}]", old, key);
@ -116,4 +119,10 @@ public class Stash {
}
}
}
@Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
builder.field("stash", stash);
return builder;
}
}