summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2017-07-02Cleanup network / transport related settings (#25489)Simon Willnauer
This commit makes the use of the global network settings explicit instead of implicit within NetworkService. It cleans up several places where we fall back to the global settings while we should have used tcp or http ones. In addition this change also removes unnecessary settings classes
2017-06-30Upgrading HDFS Repository Plugin to use HDFS 2.8.1 Client (#25497)James Baiera
Hadoop 2.7.x libraries fail when running on JDK9 due to the version string changing to a single character. On Hadoop 2.8, this is no longer a problem, and it is unclear on whether the fix will be backported to the 2.7 branch. This commit upgrades our dependency of Hadoop for the HDFS Repository to 2.8.1.
2017-06-29Add NioTransport threads to thread name checks (#25477)Tim Brooks
We have various assertions that check we never block on transport threads. This commit adds the thread names for the NioTransport to these assertions. With this change I had to fix two places where we were calling blocking methods from the transport threads.
2017-06-29Prevent channel enqueue after selector close (#25478)Tim Brooks
This commit adds additional protection to `ESSelector` and its implementations to ensure that channels are not enqueued after the selector is closed. After a channel has been added to the queue, we check that the selector is open. If it is not, then we remove the channel from the queue. If the channel is removed successfully, we throw an `IllegalStateException`.
2017-06-29Handle ping correctly in NioTransport (#25462)Tim Brooks
Our current TCPTransport logic assumes that we do not pass pings to the TCPTransport level. This commit fixes an issue where NioTransport was passing pings to TCPTransport and leading to exceptions.
2017-06-29Tests: Remove platform specific assertion in NioSocketChannelTestsChristoph Büscher
This check depends on the language settings on the system the test runs on, e.g. it fails on Ubuntu with LANG=de_DE.UTF-8.
2017-06-29Remove QueryParseContext from parsing QueryBuilders (#25448)Christoph Büscher
Currently QueryParseContext is only a thin wrapper around an XContentParser that adds little functionality of its own. I provides helpers for long deprecated field names which can be removed and two helper methods that can be made static and moved to other classes. This is a first step in helping to remove QueryParseContext entirely.
2017-06-28Remove finicky exception message assertionTim Brooks
In SimpleNioTransportTests we assert that an IOException has a certain message. This message appears that it is not dependible (and might change based on platform). Our other transport tests (mock and netty) do not make this assertion. Instead they only assert on our application exception message. This commit removes the IOException message assertion. And retains the ConnectTransportException message assertion.
2017-06-28Introduce NioTransport into framework for testing (#24262)Tim Brooks
This commit introduces a nio based tcp transport into framework for testing. Currently Elasticsearch uses a simple blocking tcp transport for testing purposes (MockTcpTransport). This diverges from production where our current transport (netty) is non-blocking. The point of this commit is to introduce a testing variant that more closely matches the behavior of production instances.
2017-06-28Use a single method to update shard stateYannick Welsch
This commit refactors index shard to provide a single method for updating the shard state on an incoming cluster state update. Relates #25431
2017-06-26Remove path.conf settingJason Tedor
This commit removes path.conf as a valid setting and replaces it with a command-line flag for specifying a non-default path for configuration. Relates #25392
2017-06-26Move more token filters to analysis-common moduleMartijn van Groningen
The following token filters were moved: stemmer, stemmer_override, kstem, dictionary_decompounder, hyphenation_decompounder, reverse, elision and truncate. Relates to #23658
2017-06-25Test: Allow merging mock secure settings (#25387)Ryan Ernst
While real secure settings (ie an ES keystore) cannot be merged together, mocked secure settings can and need to be sometimes merged. This commit adds a merge method to allow tests to merge together multiple instances of secure settings.
2017-06-23test: Replace OldIndexBackwardsCompatibilityIT#testOldClusterStates with a ↵Martijn van Groningen
full cluster restart qa test OldIndexBackwardsCompatibilityIT#testOldClusterStates tested whether global and index metadata could be read from data directory, this can also be tested in full cluster qa test that checks cluster state via api. Relates to #24939
2017-06-22Enable a long translog retention policy by default (#25294)Boaz Leskes
#25147 added the translog deletion policy but didn't enable it by default. This PR enables a default retention of 512MB (same maximum size of the current translog) and an age of 12 hours (i.e., after 12 hours all translog files will be deleted). This increases to chance to have an ops based recovery, even if the primary flushed or the replica was offline for a few hours. In order to see which parts of the translog are committed into lucene the translog stats are extended to include information about uncommitted operations. Views now include all translog ops and guarantee, as before, that those will not go away. Snapshotting a view allows to filter out generations that are not relevant based on a specific sequence number. Relates to #10708
2017-06-22Upgrade to lucene-7.0.0-snapshot-ad2cb77. (#25349)Adrien Grand
Most notable changes: - better update concurrency: LUCENE-7868 - TopDocs.totalHits is now a long: LUCENE-7872 - QueryBuilder does not remove the boolean query around multi-term synonyms: LUCENE-7878 - removal of Fields: LUCENE-7500 For the `TopDocs.totalHits` change, this PR relies on the fact that the encoding of vInts and vLongs are compatible: you can write and read with any of them as long as the value can be represented by a positive int.
2017-06-21Update MockTransportService to the age of Transport.Connection (#25320)Boaz Leskes
MockTransportServices allows us to simulate network disruptions in our testing infra. Sadly it wasn't updated to the state of the art in Transport land. This PR brings it up to speed. Specifically: 1) Opening a connection is now also blocked (before only node connections were blocked) 2) Simplifies things using the latest connection based notification between TcpTransport and TransportService for when a disconnect happens. 3) By 2, it fixes a race condition where we may fail to respond to a sent request when it is sent concurrently with the closing of a connection. The old code relied on a node based bridge between tcp transport and transport service. Sadly, the following doesn't work any more: ``` if (transport.nodeConnected(node)) { // this a connected node, disconnecting from it will be up the exception transport.disconnectFromNode(node); <-- this may now be a noop and it doesn't mean that the transport service was notified of the disconnect between the nodeConnected check and here. } else { throw new ConnectTransportException(node, reason, e); } ```
2017-06-21Ensure we never read from a closed MockSecureSettings object (#25322)Simon Willnauer
If secure settings are closed after the node has been constructed no key-store access is permitted. We should also try to be as close as possible to the real behavior if we mock secure settings. This change also adds the same behavior as bootstrap has to InternalTestCluster to ensure we fail if we try to read from secure settings after the node has been constructed.
2017-06-20Use IndexMetaData settings as a basis for new index settings (#25310)Simon Willnauer
In MockFSDirectory we should use the actual indexes settings to build a new IndexMetaData settings object instead of the node settings. Relates to #25297
2017-06-19Tweak reindex cancel logic and add many debug logs (#25256)Nik Everett
I'm still trying to hunt down rare failures in the cancelation tests for reindex and friends. Here is the latest: https://elasticsearch-ci.elastic.co/job/elastic+elasticsearch+5.x+multijob-unix-compatibility/os=ubuntu/876/console It doesn't show much, other than that one of the tasks didn't kill itself when asked to cancel. So I'm going a bit crazy with debug logging so that the next time this comes up I can trace exactly what happened. Additionally, this tweaks the logic around how rethrottles were performed around cancel. Previously we set the `requestsPerSecond` to `0` when we cancelled the task. That was the "old way" to set them to inifity which was the intent. This switches that from `0` to `Float.MAX_VALUE` which is the "new way" to set the `requestsPerSecond` to infinity. I don't know that this is much better, but it feels better.
2017-06-19Test: do not copy secure settings when creating random directory service ↵Jay Modi
(#25297) In tests, we sometimes create a random directory service and as part of that the IndexSettings get built again. When we build them again, we need to make sure we do not set the secure settings on the new IndexMetaData object that gets created as the node settings already have the secure settings and the index settings and node settings will be combined. If both have secure settings, the settings builder will throw an AlreadySetException.
2017-06-19Simplify IndexShard indexing and deletion methods (#25249)Yannick Welsch
Indexing or deleting documents through the IndexShard interface is quite complex and error-prone. It requires multiple calls, e.g. first prepareIndexOnPrimary, then do some checks if mapping updates have occurred, then do the actual indexing using index(...) etc. Currently each consumer of the interface (local recovery, peer recovery, replication) has additional custom checks built around it to deal with mapping updates, some of which are even inconsistent. This commit aims at reducing the complexity by exposing a simpler interface on IndexShard. There are no more prepare*** methods and the mapping complexity is also hidden, but still giving callers a possibility to implement custom logic to deal with mapping updates.
2017-06-19test: Port the remaining old indices search tests to full cluster restart qa ↵Martijn van Groningen
module Also tweaked the qa module's gradle file to actually run bwc tests against all index compat versions. Relates to #24939
2017-06-19Simplify connection closing and cleanups in TcpTransport (#25250)Simon Willnauer
Today we maintain a map of open connections in order to close them when a low level channel gets closed or handles a failure. We also spawn a thread due to some tricky concurrency issues especially with respect to netty since they listener might be called on a transport / boss thread. Executions on those threads must not be blocking since otherwise we will likely deadlock the event processing which adds to the complexity of the concurrency model in this class. This change associates the connection with the close callback that every channel invokes once it's closed which allows us to remove the connections map. A relaxed non-blocking concurrency model in the connection close listener allows cleaning up connected nodes without blocking on any lock.
2017-06-18[TEST] assertBusy on transport stats since some implementations invoke ↵Simon Willnauer
listeners concurrently
2017-06-17[Tests] Check that parsing aggregations works in a forward compatible way ↵Christoph Büscher
(#25219) This change adds tests for the aggregation parsing that try to simulate that we can parse existing aggregations in a forward compatible way in the future, ignoring potential newly added fields or substructures to the xContent response.
2017-06-16Remove assemble from build task when assemble removedNik Everett
Removes the `assemble` task from the `build` task when we have removed `assemble` from the project. We removed `assemble` from projects that aren't published so our releases will be faster. But That broke CI because CI builds with `gradle precommit build` and, it turns out, that `build` includes `check` and `assemble`. With this change CI will only run `check` for projects without an `assemble`.
2017-06-16Move TransportStats accounting into TcpTransport (#25251)Simon Willnauer
Today TcpTransport is the de-facto base-class for transport implementations. The need for all the callbacks we have in TransportServiceAdaptor are not necessary anymore since we can simply have the logic inside the base class itself. This change moves the stats metrics directly into TcpTransport removing the need for low level bytes send / received callbacks.
2017-06-16Remove assemble task when not used for publishing (#25228)Nik Everett
Removes the `assemble` task from projects that are not published. This should speed up `gradle assemble` by skipping projects that don't need to be built. Which is useful because `gradle assemble` is how we cut releases.
2017-06-15Add unit test for PathHierarchyTokenizerFactory (#24984)Christoph Büscher
2017-06-15Moved more token filters to analysis-common module.Martijn van Groningen
The following token filters were moved: `edge_ngram`, `ngram`, `uppercase`, `lowercase`, `length`, `flatten_graph` and `unique`. Relates to #23658
2017-06-15move assertBusy to use CheckException (#25246)Boaz Leskes
We use assertBusy in many places where the underlying code throw exceptions. Currently we need to wrap those exceptions in a RuntimeException which is ugly.
2017-06-15Upgrade to lucene-7.0.0-snapshot-92b1783. (#25222)Adrien Grand
This snapshot has faster range queries on range fields (LUCENE-7828), more accurate norms (LUCENE-7730) and the ability to use fake term frequencies (LUCENE-7854).
2017-06-14Scripting: Rename SearchScript.needsScores to needs_score (#25235)Ryan Ernst
This commit renames the needsScores method so as to make it automatically generatable, based on the name of the `_score` variable which is available in search scripts. It also adds documentation to ScriptContext to explain the naming and signature of such methods.
2017-06-14Extract the snapshot/restore full cluster restart tests from the translog ↵Nik Everett
full cluster restart tests (#25204) Extract the snapshot/restore full cluster restart tests from the translog full cluster restart tests. That way they are easier to read.
2017-06-14Test: allow setting socket timeout for rest client (#25221)Jay Modi
In #25201, a setting was added to allow setting the retry timeout for the rest client under the impression that this would allow requests to go longer than 30s. However, there is also a socket timeout that needs to be set to greater than 30s, which this change adds a setting for.
2017-06-13expose simple pattern tokenizers (#25159)Andy Bristol
Expose the experimental simplepattern and simplepatternsplit tokenizers in the common analysis plugin. They provide tokenization based on regular expressions, using Lucene's deterministic regex implementation that is usually faster than Java's and has protections against creating too-deep stacks during matching. Both have a not-very-useful default pattern of the empty string because all tokenizer factories must be able to be instantiated at index creation time. They should always be configured by the user in practice.
2017-06-13Test: add setting to change request timeout for rest client (#25201)Jay Modi
This commit adds a setting to change the request timeout for the rest client. This is useful as the default timeout is 30s, which is also the same default for calls like cluster health. If both are the same then the response from the cluster health api will not be received as the client usually times out first making test failures harder to debug. Relates #25185
2017-06-13Ensure pending transport handlers are invoked for all channel failures (#25150)Simon Willnauer
Today if a channel gets closed due to a disconnect we notify the response handler that the connection is closed and the node is disconnected. Unfortunately this is not a complete solution since it only works for published connections. Connections that are unpublished ie. for discovery can indefinitely hang since we never invoke their handers when we get a failure while a user is waiting for the response. This change adds connection tracking to TcpTransport that ensures we are notifying the corresponding connection if there is a failure on a channel.
2017-06-08remove Ingest's Internal Template Service (#25085)Tal Levy
Ingest was using it's own wrapper around TemplateScripts and the ScriptService. This commit removes that abstraction
2017-06-08Correctly enable _all for older 5.x indicesLee Hinman
When we disabled `_all` by default for indices created in 6.0, we missed adding a layer that would handle the situation where `_all` was not enabled in 5.x and then the cluster was updated to 6.0, this means that when the cluster was updated the `_all` field would be disabled for 5.x indices and field values would not be added to the `_all` field. This adds a compatibility layer for 5.x indices where we treat the default enabled value for the `_all` field to be `true` if unset on 5.x indices. Resolves #25068
2017-06-08Make randomVersionBetween work with unreleased versions (#25042)Nik Everett
Test: randomVersionBetween works with unreleased Modifies randomVersionBetween so that it works with unreleased versions. This should make switching a version from unreleased to released much simpler.
2017-06-08Use correct primary term for replicating NOOPs (#25128)Yannick Welsch
NOOPs should be, same as for indexing operations, written on the replica using the original operation term instead of the current term of the replica.
2017-06-08Automatically early terminate search query based on index sorting (#24864)Jim Ferenczi
This commit refactors the query phase in order to be able to automatically detect queries that can be early terminated. If the index sort matches the query sort, the top docs collection is early terminated on each segment and the computing of the total number of hits that match the query is delegated to a simple TotalHitCountCollector. This change also adds a new parameter to the search request called `track_total_hits`. It indicates if the total number of hits that match the query should be tracked. If false, queries sorted by the index sort will not try to compute this information and and will limit the collection to the first N documents per segment. Aggregations are not impacted and will continue to see every document even when the index sort matches the query sort and `track_total_hits` is false. Relates #6720
2017-06-08Always use DisjunctionMaxQuery to build cross fields disjunction (#25115)Jim Ferenczi
This commit modifies query_string, simple_query_string and multi_match queries to always use a DisjunctionMaxQuery when a disjunction over multiple fields is built. The tiebreaker is set to 1 in order to behave like the boolean query in terms of scoring. The removal of the coord factor in Lucene 7 made this change mandatory to correctly handle minimum_should_match. Closes #23966
2017-06-08[TEST] Move test skip/blacklist assumptions out of @Before method (#25100)David Roberts
This commit moves the assumeFalse() calls that implement test skipping and blacklisting out of the @Before method of ESClientYamlSuiteTestCase. The problem with having them in the @Before method is that if an assumption triggers then the @Before methods of classes that extend ESClientYamlSuiteTestCase will not run, but their @After methods will. This can lead to inconsistencies that cause assertions in the @After methods and fail the test even though it was skipped/blacklisted. Instead the assumeFalse() calls are now at the beginning of the test() method, which runs after all @Before methods (including those in classes that extend ESClientYamlSuiteTestCase) have completed. The only side effect is that overridden test() methods in classes that extend ESClientYamlSuiteTestCase which call super.test() and also do other things must now be designed not to consume any InternalAssumptionViolatedException that may be thrown by the super.test() call. Relates elastic/x-pack-elasticsearch#1650
2017-06-07Generate Painless Factory for Creating Script Instances (#25120)Jack Conradson
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