Skip to content

Commit 65b1582

Browse files
committed
Merge branch 'master' into 25035_shrink_api_fix_only
* master: (181 commits) Use a non default port range in MockTransportService Add a shard filter search phase to pre-filter shards based on query rewriting (elastic#25658) Prevent excessive disk consumption by log files Migrate RestHttpResponseHeadersIT to ESRestTestCase (elastic#25675) Use config directory to find jvm.options Fix inadvertent rename of systemd tests Adding basic search request documentation for high level client (elastic#25651) Disallow lang to be used with Stored Scripts (elastic#25610) Fix typo in ScriptDocValues deprecation warnings (elastic#25672) Changes DocValueFieldsFetchSubPhase to reuse doc values iterators for multiple hits (elastic#25644) Query range fields by doc values when they are expected to be more efficient than points. Remove SearchHit#internalHits (elastic#25653) [DOCS] Reorganized the highlighting topic so it's less confusing. Add an underscore to flood stage setting Avoid failing install if system-sysctl is masked Add another parent value option to join documentation (elastic#25609) Ensure we rewrite common queries to `match_none` if possible (elastic#25650) Remove reference to field-stats docs. Optimize the order of bytes in uuids for better compression. (elastic#24615) Fix BytesReferenceStreamInput#skip with offset (elastic#25634) ...
2 parents a16d3b1 + b7bc790 commit 65b1582

File tree

942 files changed

+24526
-8764
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

942 files changed

+24526
-8764
lines changed

TESTING.asciidoc

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,8 @@ These are the linux flavors the Vagrantfile currently supports:
347347

348348
* ubuntu-1404 aka trusty
349349
* ubuntu-1604 aka xenial
350-
* debian-8 aka jessie, the current debian stable distribution
350+
* debian-8 aka jessie
351+
* debian-9 aka stretch, the current debian stable distribution
351352
* centos-6
352353
* centos-7
353354
* fedora-25
@@ -470,6 +471,29 @@ is tested depends on the branch. On master, this will test against the current
470471
stable branch. On the stable branch, it will test against the latest release
471472
branch. Finally, on a release branch, it will test against the most recent release.
472473

474+
=== BWC Testing against a specific branch
475+
476+
Sometimes a backward compatibility change spans two versions. A common case is a new functionality
477+
that needs a BWC bridge in and an unreleased versioned of a release branch (for example, 5.x).
478+
To test the changes, you can instruct gradle to build the BWC version from a local branch instead of
479+
pulling the release branch from GitHub. You do so using the `tests.bwc.refspec` system property:
480+
481+
-------------------------------------------------
482+
gradle check -Dtests.bwc.refspec=origin/index_req_bwc_5.x
483+
-------------------------------------------------
484+
485+
The branch needs to be available on the local clone that the BWC makes of the repository you run the
486+
tests from. Using the `origin` remote is a handy trick to make sure that a branch is available
487+
and is up to date in the case of multiple runs.
488+
489+
Example:
490+
491+
Say you need to make a change to `master` and have a BWC layer in `5.x`. You will need to:
492+
. Create a branch called `index_req_change` off `master`. This will contain your change.
493+
. Create a branch called `index_req_bwc_5.x` off `5.x`. This will contain your bwc layer.
494+
. If not running the tests locally, push both branches to your remote repository.
495+
. Run the tests with `gradle check -Dtests.bwc.refspec=origin/index_req_bwc_5.x`
496+
473497
== Coverage analysis
474498

475499
Tests can be run instrumented with jacoco to produce a coverage report in

Vagrantfile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,17 @@ Vagrant.configure(2) do |config|
3333
[ -f /usr/share/java/jayatanaag.jar ] || install jayatana
3434
SHELL
3535
end
36-
# Wheezy's backports don't contain Openjdk 8 and the backflips required to
37-
# get the sun jdk on there just aren't worth it. We have jessie for testing
38-
# debian and it works fine.
36+
# Wheezy's backports don't contain Openjdk 8 and the backflips
37+
# required to get the sun jdk on there just aren't worth it. We have
38+
# jessie and stretch for testing debian and it works fine.
3939
config.vm.define "debian-8" do |config|
4040
config.vm.box = "elastic/debian-8-x86_64"
4141
deb_common config
4242
end
43+
config.vm.define "debian-9" do |config|
44+
config.vm.box = "elastic/debian-9-x86_64"
45+
deb_common config
46+
end
4347
config.vm.define "centos-6" do |config|
4448
config.vm.box = "elastic/centos-6-x86_64"
4549
rpm_common config

buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterFormationTasks.groovy

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ package org.elasticsearch.gradle.test
2121
import org.apache.tools.ant.DefaultLogger
2222
import org.apache.tools.ant.taskdefs.condition.Os
2323
import org.elasticsearch.gradle.LoggedExec
24+
import org.elasticsearch.gradle.Version
2425
import org.elasticsearch.gradle.VersionProperties
2526
import org.elasticsearch.gradle.plugin.PluginBuildPlugin
2627
import org.elasticsearch.gradle.plugin.PluginPropertiesExtension
@@ -312,6 +313,9 @@ class ClusterFormationTasks {
312313
// Default the watermarks to absurdly low to prevent the tests from failing on nodes without enough disk space
313314
esConfig['cluster.routing.allocation.disk.watermark.low'] = '1b'
314315
esConfig['cluster.routing.allocation.disk.watermark.high'] = '1b'
316+
if (Version.fromString(node.nodeVersion).major >= 6) {
317+
esConfig['cluster.routing.allocation.disk.watermark.flood_stage'] = '1b'
318+
}
315319
esConfig.putAll(node.config.settings)
316320

317321
Task writeConfig = project.tasks.create(name: name, type: DefaultTask, dependsOn: setup)

buildSrc/src/main/groovy/org/elasticsearch/gradle/test/NodeInfo.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ class NodeInfo {
158158
args.add("${property.key.substring('tests.es.'.size())}=${property.value}")
159159
}
160160
}
161-
env.put('ES_JVM_OPTIONS', new File(confDir, 'jvm.options'))
161+
env.put('CONF_DIR', confDir)
162162
if (Version.fromString(nodeVersion).major == 5) {
163163
args.addAll("-E", "path.conf=${confDir}")
164164
} else {

buildSrc/src/main/groovy/org/elasticsearch/gradle/vagrant/VagrantTestPlugin.groovy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ class VagrantTestPlugin implements Plugin<Project> {
1818
'centos-6',
1919
'centos-7',
2020
'debian-8',
21+
'debian-9',
2122
'fedora-25',
2223
'oel-6',
2324
'oel-7',

buildSrc/src/main/resources/checkstyle_suppressions.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,6 @@
266266
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]MergePolicyConfig.java" checks="LineLength" />
267267
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]SearchSlowLog.java" checks="LineLength" />
268268
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]analysis[/\\]AnalysisRegistry.java" checks="LineLength" />
269-
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]analysis[/\\]CommonGramsTokenFilterFactory.java" checks="LineLength" />
270269
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]analysis[/\\]CustomAnalyzerProvider.java" checks="LineLength" />
271270
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]analysis[/\\]ShingleTokenFilterFactory.java" checks="LineLength" />
272271
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]analysis[/\\]StemmerOverrideTokenFilterFactory.java" checks="LineLength" />
@@ -564,9 +563,7 @@
564563
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]IndexingSlowLogTests.java" checks="LineLength" />
565564
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]MergePolicySettingsTests.java" checks="LineLength" />
566565
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]SearchSlowLogTests.java" checks="LineLength" />
567-
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]analysis[/\\]PatternCaptureTokenFilterTests.java" checks="LineLength" />
568566
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]analysis[/\\]PreBuiltAnalyzerTests.java" checks="LineLength" />
569-
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]analysis[/\\]commongrams[/\\]CommonGramsTokenFilterFactoryTests.java" checks="LineLength" />
570567
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]engine[/\\]InternalEngineMergeIT.java" checks="LineLength" />
571568
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]engine[/\\]InternalEngineTests.java" checks="LineLength" />
572569
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]fielddata[/\\]AbstractFieldDataTestCase.java" checks="LineLength" />

buildSrc/version.properties

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# When updating elasticsearch, please update 'rest' version in core/src/main/resources/org/elasticsearch/bootstrap/test-framework.policy
2-
elasticsearch = 6.0.0-alpha3
3-
lucene = 7.0.0-snapshot-ad2cb77
2+
elasticsearch = 6.0.0-beta1
3+
lucene = 7.0.0-snapshot-00142c9
44

55
# optional dependencies
66
spatial4j = 0.6
@@ -10,10 +10,10 @@ snakeyaml = 1.15
1010
# When updating log4j, please update also docs/java-api/index.asciidoc
1111
log4j = 2.8.2
1212
slf4j = 1.6.2
13-
jna = 4.4.0
13+
jna = 4.4.0-1
1414

1515
# test dependencies
16-
randomizedrunner = 2.5.0
16+
randomizedrunner = 2.5.2
1717
junit = 4.12
1818
httpclient = 4.5.2
1919
# When updating httpcore, please also update core/src/main/resources/org/elasticsearch/bootstrap/test-framework.policy
@@ -25,7 +25,7 @@ commonscodec = 1.10
2525
hamcrest = 1.3
2626
securemock = 1.2
2727
# When updating mocksocket, please also update core/src/main/resources/org/elasticsearch/bootstrap/test-framework.policy
28-
mocksocket = 1.1
28+
mocksocket = 1.2
2929

3030
# benchmark dependencies
3131
jmh = 1.17.3

client/client-benchmark-noop-api-plugin/src/main/java/org/elasticsearch/plugin/noop/action/search/TransportNoopSearchAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,6 @@ protected void doExecute(SearchRequest request, ActionListener<SearchResponse> l
5353
new SearchHit[0], 0L, 0.0f),
5454
new InternalAggregations(Collections.emptyList()),
5555
new Suggest(Collections.emptyList()),
56-
new SearchProfileShardResults(Collections.emptyMap()), false, false, 1), "", 1, 1, 0, new ShardSearchFailure[0]));
56+
new SearchProfileShardResults(Collections.emptyMap()), false, false, 1), "", 1, 1, 0, 0, new ShardSearchFailure[0]));
5757
}
5858
}

client/rest-high-level/src/main/java/org/elasticsearch/client/RestHighLevelClient.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@
5656
import org.elasticsearch.search.aggregations.bucket.adjacency.AdjacencyMatrixAggregationBuilder;
5757
import org.elasticsearch.search.aggregations.bucket.adjacency.ParsedAdjacencyMatrix;
5858
import org.elasticsearch.search.aggregations.bucket.filter.FilterAggregationBuilder;
59+
import org.elasticsearch.search.aggregations.bucket.filter.FiltersAggregationBuilder;
5960
import org.elasticsearch.search.aggregations.bucket.filter.ParsedFilter;
60-
import org.elasticsearch.search.aggregations.bucket.filters.FiltersAggregationBuilder;
61-
import org.elasticsearch.search.aggregations.bucket.filters.ParsedFilters;
61+
import org.elasticsearch.search.aggregations.bucket.filter.ParsedFilters;
6262
import org.elasticsearch.search.aggregations.bucket.geogrid.GeoGridAggregationBuilder;
6363
import org.elasticsearch.search.aggregations.bucket.geogrid.ParsedGeoHashGrid;
6464
import org.elasticsearch.search.aggregations.bucket.global.GlobalAggregationBuilder;
@@ -73,12 +73,12 @@
7373
import org.elasticsearch.search.aggregations.bucket.nested.ParsedNested;
7474
import org.elasticsearch.search.aggregations.bucket.nested.ParsedReverseNested;
7575
import org.elasticsearch.search.aggregations.bucket.nested.ReverseNestedAggregationBuilder;
76+
import org.elasticsearch.search.aggregations.bucket.range.DateRangeAggregationBuilder;
77+
import org.elasticsearch.search.aggregations.bucket.range.GeoDistanceAggregationBuilder;
78+
import org.elasticsearch.search.aggregations.bucket.range.ParsedDateRange;
79+
import org.elasticsearch.search.aggregations.bucket.range.ParsedGeoDistance;
7680
import org.elasticsearch.search.aggregations.bucket.range.ParsedRange;
7781
import org.elasticsearch.search.aggregations.bucket.range.RangeAggregationBuilder;
78-
import org.elasticsearch.search.aggregations.bucket.range.date.DateRangeAggregationBuilder;
79-
import org.elasticsearch.search.aggregations.bucket.range.date.ParsedDateRange;
80-
import org.elasticsearch.search.aggregations.bucket.range.geodistance.GeoDistanceAggregationBuilder;
81-
import org.elasticsearch.search.aggregations.bucket.range.geodistance.ParsedGeoDistance;
8282
import org.elasticsearch.search.aggregations.bucket.sampler.InternalSampler;
8383
import org.elasticsearch.search.aggregations.bucket.sampler.ParsedSampler;
8484
import org.elasticsearch.search.aggregations.bucket.significant.ParsedSignificantLongTerms;

client/rest-high-level/src/test/java/org/elasticsearch/client/RestHighLevelClientTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ public void testInfo() throws IOException {
153153
public void testSearchScroll() throws IOException {
154154
Header[] headers = randomHeaders(random(), "Header");
155155
SearchResponse mockSearchResponse = new SearchResponse(new SearchResponseSections(SearchHits.empty(), InternalAggregations.EMPTY,
156-
null, false, false, null, 1), randomAlphaOfLengthBetween(5, 10), 5, 5, 100, new ShardSearchFailure[0]);
156+
null, false, false, null, 1), randomAlphaOfLengthBetween(5, 10), 5, 5, 0, 100, new ShardSearchFailure[0]);
157157
mockResponse(mockSearchResponse);
158158
SearchResponse searchResponse = restHighLevelClient.searchScroll(new SearchScrollRequest(randomAlphaOfLengthBetween(5, 10)),
159159
headers);

client/rest-high-level/src/test/java/org/elasticsearch/client/SearchIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ public void testSearchWithMatrixStats() throws IOException {
269269
assertEquals(5, matrixStats.getFieldCount("num2"));
270270
assertEquals(29d, matrixStats.getMean("num2"), 0d);
271271
assertEquals(330d, matrixStats.getVariance("num2"), 0d);
272-
assertEquals(-0.13568039346585542, matrixStats.getSkewness("num2"), 0d);
272+
assertEquals(-0.13568039346585542, matrixStats.getSkewness("num2"), 1.0e-16);
273273
assertEquals(1.3517561983471074, matrixStats.getKurtosis("num2"), 0d);
274274
assertEquals(-767.5, matrixStats.getCovariance("num", "num2"), 0d);
275275
assertEquals(-0.9876336291667923, matrixStats.getCorrelation("num", "num2"), 0d);

0 commit comments

Comments
 (0)