summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2017-06-07Tests: Add ability to generate random new fields for xContent parsing test ↵Christoph Büscher
(#23437) For the response parsing we want to be lenient when it comes to parsing new xContent fields. In order to ensure this in our testing, this change adds a utility method to XContentTestUtils that takes xContent bytes representation as input and recursively a random field on each object level. Sometimes we also want to exclude a whole subtree from this treatment (e.g. skipping "_source"), other times an element (e.g. "fields", "highlight" in SearchHit) can have arbitraryly named objects. Those cases can be specified as exceptions.
2017-06-07Remove TranslogRecoveryPerformer (#24858)Yannick Welsch
Splits TranslogRecoveryPerformer into three parts: - the translog operation to engine operation converter - the operation perfomer (that indexes the operation into the engine) - the translog statistics (for which there is already RecoveryState.Translog) This makes it possible for peer recovery to use the same IndexShard interface as bulk shard requests (i.e. Engine operations instead of Translog operations). It also pushes the "fail on bad mapping" logic outside of IndexShard. Future pull requests could unify the BulkShard and peer recovery path even more.
2017-06-07Add version 5.6 to versions (#25084)Tim Brooks
* Add version 5.6 to versions * Fix test * Remove 5.4.2 constant
2017-06-06Bumping version to v6.0.0-alpha3 (#25077)Tim Brooks
2017-06-06Move parent_id query to the parent-join module (#25072)Jim Ferenczi
This change moves the parent_id query to the parent-join module and handles the case when only the parent-join field can be declared on an index (index with single type on). If single type is off it uses the legacy parent join field mapper and switch to the new one otherwise (default in 6). Relates #20257
2017-06-05Plugins can register pre-configured char filters (#25000)Nik Everett
Fixes the plumbing so plugins can register char filters and moves the `html_strip` char filter into analysis-common. Relates to #23658
2017-06-02Test that gradle and Java version types match (#24943)Nik Everett
Both gradle and java code attempt to infer the type of a each Version constant in Version.java. It is super important that they infer that each constant has the same type. If they disagree we might accidentally not be testing backwards compatibility for some version. This adds a test to make sure that they agree, modulo known and accepted differences (mostly around alphas). It also changes the minimum wire compatible version from the released 5.4.0 to the unreleased 5.5.0 as that lines up with the gradle logic. Relates to #24798 Note that the gradle and java version logic doesn't actually match so this contains a hack to make it *look* like it matches. Since this is a start, I'm merging it and going to work on some followups to make the logic actually match.....
2017-06-02Scripting: Convert CompiledTemplate to a ScriptContext (#25032)Ryan Ernst
This commit creates TemplateScript and associated classes so that templates no longer need a special ScriptService.compileTemplate method. The execute() method is equivalent to the old run() method. relates #20426
2017-06-02Checks the circuit breaker before allocating bytes for a new big array (#25010)Ali Beyad
Previously, when allocating bytes for a BigArray, the array was created (or attempted to be created) and only then would the array be checked for the amount of RAM used to see if the circuit breaker should trip. This is problematic because for very large arrays, if creating or resizing the array, it is possible to attempt to create/resize and get an OOM error before the circuit breaker trips, because the allocation happens before checking with the circuit breaker. This commit ensures that the circuit breaker is checked before all big array allocations (note, this does not effect the array allocations that are less than 16kb which use the [Type]ArrayWrapper classes found in BigArrays.java). If such an allocation or resizing would cause the circuit breaker to trip, then the breaker trips before attempting to allocate and potentially running into an OOM error from the JVM. Closes #24790
2017-06-02reduce the number of threads used by testNotBlockingUnsafeStackTracesBoaz Leskes
It times out some times. Fixes #24936
2017-06-02Test: improve error message on leftover tasksNik Everett
After every REST test we wait for the list of pending cluster tasks to empty before moving on to the next task. If the list doesn't empty in 10 second we fail the test. This improves the error message when we fail the test to include the list of running tasks.
2017-06-01[Tests] Improve error message for failed xContentEquivalent() tests (#24828)Christoph Büscher
For comparing actual and parsed object equality for the response parsing we currently rely on comparing the original xContent and the output of the parsed object. Currently we only have cryptic error messages if this comparison fails which are hard to read also because we recursively compare lists and maps of the xContent structures we compare. This commits leverages the existing NotEqualMessageBuilder for providing error messages that are more detailed and useful for debugging if an error occurs.
2017-05-31Moved `keyword_marker`, `trim`, `snowball` and `porter_stemmer` tokenfilter ↵Martijn van Groningen
factories from core to common-analysis module. Relates to #23658
2017-05-31Added more unit test coverage for terms aggregation andMartijn van Groningen
removed terms agg integration tests that were replaced by unit tests.
2017-05-30Scripting: Add StatefulFactoryType as optional intermediate factory in ↵Ryan Ernst
script contexts (#24974) ScriptContexts currently understand a FactoryType that can produce instances of the script InstanceType. However, for search scripts, this does not work as we have the concept of LeafSearchScript that is created per lucene segment. This commit effectively renames the existing SearchScript class into SearchScript.LeafFactory, which is a new, optional, class that can be defined within a ScriptContext. LeafSearchScript is effectively renamed back into SearchScript. This change allows the model of stateless factory -> stateful factory -> script instance to continue, but in a generic way that any script context may take advantage of. relates #20426
2017-05-26Remove the need for _UNRELEASED suffix in versions (#24798)Nik Everett
Removes the need for the `_UNRELEASED` suffix on versions by detecting if a version should be unreleased or not based on the versions around it. This should make it simpler to automate the task of adding a new version label.
2017-05-26Merge branch 'mattweber-multiple_collapse_inner_hits'Jim Ferenczi
2017-05-26Support Multiple Collapse Inner HitsMatt Weber
Support multiple named inner hits on a field collapsing request.
2017-05-26Scripting: Rename CompiledType to FactoryType in ScriptContext (#24897)Ryan Ernst
This commit renames the concept of the "compiled type" to a "factory type", along with all implementations of this class to be named Factory. This brings it inline with the classes purpose.
2017-05-25Scripting: Make contexts available to ScriptEngine construction (#24896)Ryan Ernst
This commit adds collection of all contexts to the parameters of getScriptEngine. This will allow script engines like painless to precache extra information about the contexts.
2017-05-24Scripting: Make ScriptEngine.compile generic on the script context (#24873)Ryan Ernst
This commit changes the compile method of ScriptEngine to be generic in the same way it is on ScriptService. This moves the shim of handling the two existing context classes into each script engine, so that each engine can be worked on independently to convert to real handling of contexts.
2017-05-24Scripting: Add instance and compiled classes to script contexts (#24868)Ryan Ernst
This commit modifies the compile method of ScriptService to be context aware. The ScriptContext is now a generic class which contains both the instance type and compiled type for a script. Instance type may be stateful (for example, pre loading field information for the index a script will execute on, like in expressions), while the compiled type is stateless and used to construct instance type instances. This change is only a first step to cutover ScriptService to the new paradigm. It only converts callers to the script service, and has a small shim to wrap compilation from the script engines to support the current two fixed instance types, SearchScript and ExecutableScript.
2017-05-24Scripting: Add default implementation of close() for ScriptEngine (#24851)Ryan Ernst
Since groovy was removed, we no longer have any ScriptEngines with resources to release. We may want to keep the option open for a script engine to close resources, but this would not be common. This commit adds a default implementation to ScriptEngine for `close()` to reduce the boiler plate that must be added for a ScriptEngine implementation.
2017-05-24Guarantee that translog generations are seqNo conflict free (#24825)Boaz Leskes
With #24779 in place, we can now guaranteed that a single translog generation file will never have a sequence number conflict that needs to be resolved by looking at primary terms. These conflicts can a occur when a replica contains an operation which isn't part of the history of a newly promoted primary. That primary can then assign a different operation to the same slot and replicate it to the replica. PS. Knowing that each generation file is conflict free will simplifying repairing these conflicts when we read from the translog. PPS. This PR also fixes some bugs in the piping of primary terms in the bulk shard action. These bugs are a result of the legacy of IndexRequest/DeleteRequest being a ReplicationRequest. We need to change that as a follow up. Relates to #10708
2017-05-23Test: Convert test script engine impls to use MockScriptEngine (#24854)Ryan Ernst
This commit cleans up tests which currently use custom script engine implementations, converting them to use a MockScriptEngine with script functions provided by the tests. It also creates a common set of metric scripts which were copied across a couple metric agg tests.
2017-05-23Increase max compilations per minute in testsJason Tedor
Large test suites with unfortunate seed choices can easily exceed the 1000 script compilations per minute limit. This commit increases the limit in integration tests to 2048.
2017-05-23Add magic $_path stash key to docs tests (#24724)Nik Everett
Adds a "magic" key to the yaml testing stash mostly for use with documentation tests. When unstashing an object, `$_path` is the path into the current position in the object you are unstashing. This means that in docs tests you can use `// TESTRESPONSEs/somevalue/$body.${_path}/` to mean "replace `somevalue` with whatever is the response in the same position." Compare how you must carefully mock out all the numbers in the profile response without this change: ``` // TESTRESPONSE[s/"id": "\[2aE02wS1R8q_QFnYu6vDVQ\]\[twitter\]\[1\]"/"id": $body.profile.shards.0.id/] // TESTRESPONSE[s/"rewrite_time": 51443/"rewrite_time": $body.profile.shards.0.searches.0.rewrite_time/] // TESTRESPONSE[s/"score": 51306/"score": $body.profile.shards.0.searches.0.query.0.breakdown.score/] // TESTRESPONSE[s/"time_in_nanos": "1873811"/"time_in_nanos": $body.profile.shards.0.searches.0.query.0.time_in_nanos/] // TESTRESPONSE[s/"build_scorer": 2935582/"build_scorer": $body.profile.shards.0.searches.0.query.0.breakdown.build_scorer/] // TESTRESPONSE[s/"create_weight": 919297/"create_weight": $body.profile.shards.0.searches.0.query.0.breakdown.create_weight/] // TESTRESPONSE[s/"next_doc": 53876/"next_doc": $body.profile.shards.0.searches.0.query.0.breakdown.next_doc/] // TESTRESPONSE[s/"time_in_nanos": "391943"/"time_in_nanos": $body.profile.shards.0.searches.0.query.0.children.0.time_in_nanos/] // TESTRESPONSE[s/"score": 28776/"score": $body.profile.shards.0.searches.0.query.0.children.0.breakdown.score/] // TESTRESPONSE[s/"build_scorer": 784451/"build_scorer": $body.profile.shards.0.searches.0.query.0.children.0.breakdown.build_scorer/] // TESTRESPONSE[s/"create_weight": 1669564/"create_weight": $body.profile.shards.0.searches.0.query.0.children.0.breakdown.create_weight/] // TESTRESPONSE[s/"next_doc": 10111/"next_doc": $body.profile.shards.0.searches.0.query.0.children.0.breakdown.next_doc/] // TESTRESPONSE[s/"time_in_nanos": "210682"/"time_in_nanos": $body.profile.shards.0.searches.0.query.0.children.1.time_in_nanos/] // TESTRESPONSE[s/"score": 4552/"score": $body.profile.shards.0.searches.0.query.0.children.1.breakdown.score/] // TESTRESPONSE[s/"build_scorer": 42602/"build_scorer": $body.profile.shards.0.searches.0.query.0.children.1.breakdown.build_scorer/] // TESTRESPONSE[s/"create_weight": 89323/"create_weight": $body.profile.shards.0.searches.0.query.0.children.1.breakdown.create_weight/] // TESTRESPONSE[s/"next_doc": 2852/"next_doc": $body.profile.shards.0.searches.0.query.0.children.1.breakdown.next_doc/] // TESTRESPONSE[s/"time_in_nanos": "304311"/"time_in_nanos": $body.profile.shards.0.searches.0.collector.0.time_in_nanos/] // TESTRESPONSE[s/"time_in_nanos": "32273"/"time_in_nanos": $body.profile.shards.0.searches.0.collector.0.children.0.time_in_nanos/] ``` To how you can cavalierly mock all the numbers at once with this change: ``` // TESTRESPONSE[s/(?<=[" ])\d+(\.\d+)?/$body.$_path/] ```
2017-05-23Added unit tests for MatrixStatsAggregatorMartijn van Groningen
2017-05-23Remove unused assertions enabled methodJason Tedor
This commit removes an unused assertions enabled method in ESTestCase. For future uses of such a method, use the field ENABLED in org.elasticsearch.Assertions.
2017-05-23Add the ability to define custom inner hit sub context builder (#24676)Jim Ferenczi
This commit moves the handling of nested and parent/child inner hits to specialized classes that can be defined outside of ES core. InnerHitBuilderContext is now used by the parent query (nested or hasChild, ...) to build the sub context from the InnerHitBuilder definition. BWC is also ensured so that nodes in previous versions can still send/receive inner hits to/from this version. Relates #20257
2017-05-22Scripting: Simplify ScriptContext (#24818)Ryan Ernst
As we work towards contexts implying the return type of compilation, we first need ScriptContext to not be an enum. This commit removes the Standard enum and Plugin subclass of ScriptContext.
2017-05-22Merge branch 'master' into feature/client_aggs_parsingjavanna
2017-05-22Move getType to Aggregation interface (#24822)Luca Cavanna
Given that both InternalAggregation and ParsedAggregation have this method, it makes sense to move it to the interface they both implement.
2017-05-20Scripting: Remove "inline script enabled" on script engines (#24815)Ryan Ernst
ScriptEngine implementations have an overridable method to indicate they are safe to use as inline scripts. Since groovy was removed fro 6.0, there are no longer any implementations which used the default false value. Furthermore, the value was not actually read anywhere. This commit removes the method. The ScriptEngineRegistry was also no longer necessary as it only was used to build a map from language to engine.
2017-05-19Merge branch 'master' into feature/client_aggs_parsingjavanna
2017-05-19Allow plugins to register pre-configured tokenizers (#24751)Nik Everett
Allows plugins to register pre-configured tokenizers. Much of the decisions are the same as those in #24223, #24572, and #24223. This only migrates the lowercase tokenizer but I figure that is a good start because it proves out the features.
2017-05-19Merge remote-tracking branch 'origin/master' into feature/client_aggs_parsingTanguy Leroux
2017-05-19Remove //norelease and cleans up somet aggregations tests (#24789)Tanguy Leroux
2017-05-18Remove Deprecated Script Settings (#24756)Jack Conradson
Removes all fine-grained script settings replaced by scripts.types_allowed and scripts.contexts_allowed.
2017-05-18Use StringBuilder to construct a String instead of relying on appending ↵Koen De Groote
where possible (#24753) This PR revolves around places in the code where introducing a StringBuilder might make the construction of a String easier to follow and also, maybe avoid a case where the compiler's very safe way of introducing StringBuilder instead of String might not always be optimal for performance.
2017-05-18Add utility method to get the latest version of the previous minorSimon Willnauer
2017-05-18Merge remote-tracking branch 'origin/master' into feature/client_aggs_parsingTanguy Leroux
2017-05-18Add parsing method for Top Hits aggregation (#24717)Tanguy Leroux
Related to #23331
2017-05-18Add parsing method for binary range aggregation (#24706)Tanguy Leroux
Related to #23331
2017-05-18Fix String concatenation within a StringBuilder append chainKoen De Groote
This commit replaces String concatenation within a StringBuilder append chain by using explicit append calls.
2017-05-17Scripting: Remove native scripts (#24726)Ryan Ernst
Native scripts have been replaced in documentation by implementing a ScriptEngine and they were deprecated in 5.5.0. This commit removes the native script infrastructure for 6.0. closes #19966
2017-05-17Scripting: Remove file scripts (#24627)Ryan Ernst
This commit removes file scripts, which were deprecated in 5.5. closes #21798
2017-05-17Add parsing for InternalScriptedMetric aggregation (#24738)Christoph Büscher
2017-05-17Merge branch 'master' into feature/client_aggs_parsingjavanna
2017-05-17Fix Version based BWC and set correct minCompatVersion (#24732)Simon Willnauer
Approaching the release of 6.0 we need to sort out the usage of `Version#minimumCompatibilityVersion` which was still set to 5.0.0. Now this change moves it to the latest released version of 5.x (5.4 at this point) to ensure we are compatible with the latest minor of the previous major. This change also removes all the `_UNRELEASED` from the versions that where released and drops versions that were never released and are not expected to be released (bugfixes in minors that are not the latest in the previous major).