From d26bf2ae52eb8c43d865b5af39b4ff0770279f8e Mon Sep 17 00:00:00 2001 From: Alpar Torok Date: Tue, 12 Jun 2018 18:45:16 +0300 Subject: [PATCH 01/28] Upgrade bouncycastle Required to fix `bcprov-jdk15on-1.55.jar; invalid manifest format ` on jdk 11 --- plugins/ingest-attachment/build.gradle | 2 +- x-pack/plugin/core/build.gradle | 4 ++-- x-pack/plugin/security/build.gradle | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/ingest-attachment/build.gradle b/plugins/ingest-attachment/build.gradle index f000fdfeef5e0..279195a573ed9 100644 --- a/plugins/ingest-attachment/build.gradle +++ b/plugins/ingest-attachment/build.gradle @@ -25,7 +25,7 @@ esplugin { versions << [ 'tika': '1.18', 'pdfbox': '2.0.9', - 'bouncycastle': '1.55', + 'bouncycastle': '1.59', 'poi': '3.17', 'mime4j': '0.8.1' ] diff --git a/x-pack/plugin/core/build.gradle b/x-pack/plugin/core/build.gradle index 4bbe339a09b79..4bb0e0ffc031b 100644 --- a/x-pack/plugin/core/build.gradle +++ b/x-pack/plugin/core/build.gradle @@ -35,8 +35,8 @@ dependencies { // security deps compile 'com.unboundid:unboundid-ldapsdk:3.2.0' - compile 'org.bouncycastle:bcprov-jdk15on:1.58' - compile 'org.bouncycastle:bcpkix-jdk15on:1.58' + compile 'org.bouncycastle:bcprov-jdk15on:1.59' + compile 'org.bouncycastle:bcpkix-jdk15on:1.59' compile project(path: ':modules:transport-netty4', configuration: 'runtime') testCompile 'org.elasticsearch:securemock:1.2' diff --git a/x-pack/plugin/security/build.gradle b/x-pack/plugin/security/build.gradle index 12533a389b5f1..90f594a00e6d2 100644 --- a/x-pack/plugin/security/build.gradle +++ b/x-pack/plugin/security/build.gradle @@ -22,8 +22,8 @@ dependencies { testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') compile 'com.unboundid:unboundid-ldapsdk:3.2.0' - compile 'org.bouncycastle:bcprov-jdk15on:1.58' - compile 'org.bouncycastle:bcpkix-jdk15on:1.58' + compile 'org.bouncycastle:bcprov-jdk15on:1.59' + compile 'org.bouncycastle:bcpkix-jdk15on:1.59' // the following are all SAML dependencies - might as well download the whole internet compile "org.opensaml:opensaml-core:3.3.0" From e13289208a03d195f9516e691ffb39c4816d6e6b Mon Sep 17 00:00:00 2001 From: Alpar Torok Date: Wed, 13 Jun 2018 11:16:07 +0300 Subject: [PATCH 02/28] Downgrade bouncycastle to avoid invalid manifest --- distribution/tools/plugin-cli/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/distribution/tools/plugin-cli/build.gradle b/distribution/tools/plugin-cli/build.gradle index c47786299bc2f..11663daf26be6 100644 --- a/distribution/tools/plugin-cli/build.gradle +++ b/distribution/tools/plugin-cli/build.gradle @@ -24,7 +24,7 @@ archivesBaseName = 'elasticsearch-plugin-cli' dependencies { compileOnly "org.elasticsearch:elasticsearch:${version}" compileOnly "org.elasticsearch:elasticsearch-cli:${version}" - compile "org.bouncycastle:bcpg-jdk15on:1.59" + compile "org.bouncycastle:bcpg-jdk15on:1.58" compile "org.bouncycastle:bcprov-jdk15on:1.59" testCompile "org.elasticsearch.test:framework:${version}" testCompile 'com.google.jimfs:jimfs:1.1' From efe184442ed23f02fb47f0780a0f3ba68ba46387 Mon Sep 17 00:00:00 2001 From: Alpar Torok Date: Wed, 13 Jun 2018 17:12:54 +0300 Subject: [PATCH 03/28] Add checksum for new jars --- .../tools/plugin-cli/licenses/bcpg-jdk15on-1.58.jar.sha1 | 1 + .../tools/plugin-cli/licenses/bcpg-jdk15on-1.59.jar.sha1 | 1 - plugins/ingest-attachment/licenses/bcmail-jdk15on-1.55.jar.sha1 | 1 - plugins/ingest-attachment/licenses/bcmail-jdk15on-1.59.jar.sha1 | 1 + plugins/ingest-attachment/licenses/bcpkix-jdk15on-1.55.jar.sha1 | 1 - plugins/ingest-attachment/licenses/bcpkix-jdk15on-1.59.jar.sha1 | 1 + plugins/ingest-attachment/licenses/bcprov-jdk15on-1.55.jar.sha1 | 1 - plugins/ingest-attachment/licenses/bcprov-jdk15on-1.59.jar.sha1 | 1 + x-pack/plugin/core/licenses/bcpkix-jdk15on-1.58.jar.sha1 | 1 - x-pack/plugin/core/licenses/bcpkix-jdk15on-1.59.jar.sha1 | 1 + x-pack/plugin/core/licenses/bcprov-jdk15on-1.58.jar.sha1 | 1 - x-pack/plugin/core/licenses/bcprov-jdk15on-1.59.jar.sha1 | 1 + 12 files changed, 6 insertions(+), 6 deletions(-) create mode 100644 distribution/tools/plugin-cli/licenses/bcpg-jdk15on-1.58.jar.sha1 delete mode 100644 distribution/tools/plugin-cli/licenses/bcpg-jdk15on-1.59.jar.sha1 delete mode 100644 plugins/ingest-attachment/licenses/bcmail-jdk15on-1.55.jar.sha1 create mode 100644 plugins/ingest-attachment/licenses/bcmail-jdk15on-1.59.jar.sha1 delete mode 100644 plugins/ingest-attachment/licenses/bcpkix-jdk15on-1.55.jar.sha1 create mode 100644 plugins/ingest-attachment/licenses/bcpkix-jdk15on-1.59.jar.sha1 delete mode 100644 plugins/ingest-attachment/licenses/bcprov-jdk15on-1.55.jar.sha1 create mode 100644 plugins/ingest-attachment/licenses/bcprov-jdk15on-1.59.jar.sha1 delete mode 100644 x-pack/plugin/core/licenses/bcpkix-jdk15on-1.58.jar.sha1 create mode 100644 x-pack/plugin/core/licenses/bcpkix-jdk15on-1.59.jar.sha1 delete mode 100644 x-pack/plugin/core/licenses/bcprov-jdk15on-1.58.jar.sha1 create mode 100644 x-pack/plugin/core/licenses/bcprov-jdk15on-1.59.jar.sha1 diff --git a/distribution/tools/plugin-cli/licenses/bcpg-jdk15on-1.58.jar.sha1 b/distribution/tools/plugin-cli/licenses/bcpg-jdk15on-1.58.jar.sha1 new file mode 100644 index 0000000000000..dd66ae4cbe1a5 --- /dev/null +++ b/distribution/tools/plugin-cli/licenses/bcpg-jdk15on-1.58.jar.sha1 @@ -0,0 +1 @@ +b92c863d75bbdbfa88f08301cb243f406a58bec4 \ No newline at end of file diff --git a/distribution/tools/plugin-cli/licenses/bcpg-jdk15on-1.59.jar.sha1 b/distribution/tools/plugin-cli/licenses/bcpg-jdk15on-1.59.jar.sha1 deleted file mode 100644 index 0c0be50c906a3..0000000000000 --- a/distribution/tools/plugin-cli/licenses/bcpg-jdk15on-1.59.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -ee93e5376bb6cf0a15c027b5f5e4393f2738e709 \ No newline at end of file diff --git a/plugins/ingest-attachment/licenses/bcmail-jdk15on-1.55.jar.sha1 b/plugins/ingest-attachment/licenses/bcmail-jdk15on-1.55.jar.sha1 deleted file mode 100644 index 8fdfb8f580780..0000000000000 --- a/plugins/ingest-attachment/licenses/bcmail-jdk15on-1.55.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -5cea2dada69b98698ea975a5c1dd3c91ac8ffbb6 \ No newline at end of file diff --git a/plugins/ingest-attachment/licenses/bcmail-jdk15on-1.59.jar.sha1 b/plugins/ingest-attachment/licenses/bcmail-jdk15on-1.59.jar.sha1 new file mode 100644 index 0000000000000..dde0a237a186b --- /dev/null +++ b/plugins/ingest-attachment/licenses/bcmail-jdk15on-1.59.jar.sha1 @@ -0,0 +1 @@ +db389ade95f48592908a84e7050a691c8834723c \ No newline at end of file diff --git a/plugins/ingest-attachment/licenses/bcpkix-jdk15on-1.55.jar.sha1 b/plugins/ingest-attachment/licenses/bcpkix-jdk15on-1.55.jar.sha1 deleted file mode 100644 index a4d546be04fc2..0000000000000 --- a/plugins/ingest-attachment/licenses/bcpkix-jdk15on-1.55.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -6392d8cba22b722c6570d660ca0b3921ff1bae4f \ No newline at end of file diff --git a/plugins/ingest-attachment/licenses/bcpkix-jdk15on-1.59.jar.sha1 b/plugins/ingest-attachment/licenses/bcpkix-jdk15on-1.59.jar.sha1 new file mode 100644 index 0000000000000..be5e561ee9a76 --- /dev/null +++ b/plugins/ingest-attachment/licenses/bcpkix-jdk15on-1.59.jar.sha1 @@ -0,0 +1 @@ +9cef0aab8a4bb849a8476c058ce3ff302aba3fff \ No newline at end of file diff --git a/plugins/ingest-attachment/licenses/bcprov-jdk15on-1.55.jar.sha1 b/plugins/ingest-attachment/licenses/bcprov-jdk15on-1.55.jar.sha1 deleted file mode 100644 index 1c507e17b88e0..0000000000000 --- a/plugins/ingest-attachment/licenses/bcprov-jdk15on-1.55.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -935f2e57a00ec2c489cbd2ad830d4a399708f979 \ No newline at end of file diff --git a/plugins/ingest-attachment/licenses/bcprov-jdk15on-1.59.jar.sha1 b/plugins/ingest-attachment/licenses/bcprov-jdk15on-1.59.jar.sha1 new file mode 100644 index 0000000000000..aa42dbb8f6906 --- /dev/null +++ b/plugins/ingest-attachment/licenses/bcprov-jdk15on-1.59.jar.sha1 @@ -0,0 +1 @@ +2507204241ab450456bdb8e8c0a8f986e418bd99 \ No newline at end of file diff --git a/x-pack/plugin/core/licenses/bcpkix-jdk15on-1.58.jar.sha1 b/x-pack/plugin/core/licenses/bcpkix-jdk15on-1.58.jar.sha1 deleted file mode 100644 index 1fbdc7fcc1fa8..0000000000000 --- a/x-pack/plugin/core/licenses/bcpkix-jdk15on-1.58.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -15a760a039b040e767a75c77ffcc4ff62558f903 \ No newline at end of file diff --git a/x-pack/plugin/core/licenses/bcpkix-jdk15on-1.59.jar.sha1 b/x-pack/plugin/core/licenses/bcpkix-jdk15on-1.59.jar.sha1 new file mode 100644 index 0000000000000..be5e561ee9a76 --- /dev/null +++ b/x-pack/plugin/core/licenses/bcpkix-jdk15on-1.59.jar.sha1 @@ -0,0 +1 @@ +9cef0aab8a4bb849a8476c058ce3ff302aba3fff \ No newline at end of file diff --git a/x-pack/plugin/core/licenses/bcprov-jdk15on-1.58.jar.sha1 b/x-pack/plugin/core/licenses/bcprov-jdk15on-1.58.jar.sha1 deleted file mode 100644 index 95bc28eb146ef..0000000000000 --- a/x-pack/plugin/core/licenses/bcprov-jdk15on-1.58.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -2c9aa1c4e3372b447ba5daabade4adf2a2264b12 \ No newline at end of file diff --git a/x-pack/plugin/core/licenses/bcprov-jdk15on-1.59.jar.sha1 b/x-pack/plugin/core/licenses/bcprov-jdk15on-1.59.jar.sha1 new file mode 100644 index 0000000000000..aa42dbb8f6906 --- /dev/null +++ b/x-pack/plugin/core/licenses/bcprov-jdk15on-1.59.jar.sha1 @@ -0,0 +1 @@ +2507204241ab450456bdb8e8c0a8f986e418bd99 \ No newline at end of file From 3acd7b59719e745a9ab774a368d112a23b0019d4 Mon Sep 17 00:00:00 2001 From: Alpar Torok Date: Wed, 13 Jun 2018 17:13:27 +0300 Subject: [PATCH 04/28] Update tika permissions for jdk 11 --- .../org/elasticsearch/ingest/attachment/TikaImpl.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/plugins/ingest-attachment/src/main/java/org/elasticsearch/ingest/attachment/TikaImpl.java b/plugins/ingest-attachment/src/main/java/org/elasticsearch/ingest/attachment/TikaImpl.java index 6606d1bc72727..75a01231ead03 100644 --- a/plugins/ingest-attachment/src/main/java/org/elasticsearch/ingest/attachment/TikaImpl.java +++ b/plugins/ingest-attachment/src/main/java/org/elasticsearch/ingest/attachment/TikaImpl.java @@ -164,12 +164,11 @@ static PermissionCollection getRestrictedPermissions() { perms.add(new RuntimePermission("getClassLoader")); // ZipFile needs accessDeclaredMembers on JDK 10; cf. https://bugs.openjdk.java.net/browse/JDK-8187485 if (JavaVersion.current().compareTo(JavaVersion.parse("10")) >= 0) { - /* - * See if this permission can be removed in JDK 11, bump the version here to 12 if not. If this permission can be removed, also - * remove the grant in the plugin-security.policy. - */ - assert JavaVersion.current().compareTo(JavaVersion.parse("11")) < 0; - perms.add(new RuntimePermission("accessDeclaredMembers")); + if (JavaVersion.current().compareTo(JavaVersion.parse("11")) < 0) { + // TODO remove this and from plugin-security.policy when JDK 11 is the only one we support + // this is needed pre 11, but it's fixed in 11 : https://bugs.openjdk.java.net/browse/JDK-8187485 + perms.add(new RuntimePermission("accessDeclaredMembers")); + } } perms.setReadOnly(); return perms; From 283b708eef0e42f9f5ca69ee18d3c413617a8566 Mon Sep 17 00:00:00 2001 From: Alpar Torok Date: Wed, 13 Jun 2018 19:21:42 +0300 Subject: [PATCH 05/28] Mute test failing on jdk 11 --- .../ingest/attachment/AttachmentProcessorTests.java | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/ingest-attachment/src/test/java/org/elasticsearch/ingest/attachment/AttachmentProcessorTests.java b/plugins/ingest-attachment/src/test/java/org/elasticsearch/ingest/attachment/AttachmentProcessorTests.java index 654bc361f53ad..b5d38fd294915 100644 --- a/plugins/ingest-attachment/src/test/java/org/elasticsearch/ingest/attachment/AttachmentProcessorTests.java +++ b/plugins/ingest-attachment/src/test/java/org/elasticsearch/ingest/attachment/AttachmentProcessorTests.java @@ -295,6 +295,7 @@ private Map parseDocument(String file, AttachmentProcessor proce return attachmentData; } + @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/31305") public void testIndexedChars() throws Exception { processor = new AttachmentProcessor(randomAlphaOfLength(10), "source_field", "target_field", EnumSet.allOf(AttachmentProcessor.Property.class), 19, false, null); From 6091a3f201294706f47112279f1cc88bdaadb26b Mon Sep 17 00:00:00 2001 From: Alpar Torok Date: Mon, 18 Jun 2018 17:41:58 +0300 Subject: [PATCH 06/28] Thread#stop(Throwable) was removed http://mail.openjdk.java.net/pipermail/core-libs-dev/2018-June/053536.html --- buildSrc/src/main/resources/forbidden/jdk-signatures.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/buildSrc/src/main/resources/forbidden/jdk-signatures.txt b/buildSrc/src/main/resources/forbidden/jdk-signatures.txt index b17495db6bfb8..4ed683218f4d6 100644 --- a/buildSrc/src/main/resources/forbidden/jdk-signatures.txt +++ b/buildSrc/src/main/resources/forbidden/jdk-signatures.txt @@ -88,7 +88,6 @@ java.lang.Thread#getAllStackTraces() @defaultMessage Stopping threads explicitly leads to inconsistent states. Use interrupt() instead. java.lang.Thread#stop() -java.lang.Thread#stop(java.lang.Throwable) @defaultMessage Please do not terminate the application java.lang.System#exit(int) From 0060bb71a254b3a55249fbbe1061677a1f259d47 Mon Sep 17 00:00:00 2001 From: Alpar Torok Date: Fri, 15 Jun 2018 12:37:21 +0300 Subject: [PATCH 07/28] Add JDK11 to CI --- .ci/java-versions.properties | 4 ++-- .ci/matrix-build-javas.yml | 1 + .ci/matrix-runtime-javas.yml | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.ci/java-versions.properties b/.ci/java-versions.properties index a0713ce128e6f..d13f1ea576c0f 100644 --- a/.ci/java-versions.properties +++ b/.ci/java-versions.properties @@ -4,5 +4,5 @@ # build and test Elasticsearch for this branch. Valid Java versions # are 'java' or 'openjdk' followed by the major release number. -ES_BUILD_JAVA=java10 -ES_RUNTIME_JAVA=java8 +ES_BUILD_JAVA=java11 +ES_RUNTIME_JAVA=java11 diff --git a/.ci/matrix-build-javas.yml b/.ci/matrix-build-javas.yml index 17aa4b0bf222a..bbb61b8eb6df0 100644 --- a/.ci/matrix-build-javas.yml +++ b/.ci/matrix-build-javas.yml @@ -7,3 +7,4 @@ ES_BUILD_JAVA: - java10 + - java11 diff --git a/.ci/matrix-runtime-javas.yml b/.ci/matrix-runtime-javas.yml index 72282ca805afd..737e15ada208a 100644 --- a/.ci/matrix-runtime-javas.yml +++ b/.ci/matrix-runtime-javas.yml @@ -8,3 +8,4 @@ ES_RUNTIME_JAVA: - java8 - java10 + - java11 From e433bce12d1dc84f1ff81109aa39ecab2df1ef59 Mon Sep 17 00:00:00 2001 From: Alpar Torok Date: Wed, 20 Jun 2018 12:43:00 +0300 Subject: [PATCH 08/28] Disable failing tests #31456 --- plugins/ingest-attachment/build.gradle | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/ingest-attachment/build.gradle b/plugins/ingest-attachment/build.gradle index 279195a573ed9..1cfe4ed0c5c6e 100644 --- a/plugins/ingest-attachment/build.gradle +++ b/plugins/ingest-attachment/build.gradle @@ -30,6 +30,10 @@ versions << [ 'mime4j': '0.8.1' ] +// disabled untill https://github.com/elastic/elasticsearch/issues/31456 +// is fixed. +integTest.enabled = false + dependencies { // mandatory for tika compile "org.apache.tika:tika-core:${versions.tika}" From be6fe540f2de1c5226793ac6c320371c0973cfd1 Mon Sep 17 00:00:00 2001 From: Alpar Torok Date: Wed, 20 Jun 2018 18:00:41 +0300 Subject: [PATCH 09/28] Temprorarily disable doc tests To see if there are other failures on JDK11 --- docs/build.gradle | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/build.gradle b/docs/build.gradle index 790820c976547..ed53e5c7d32cd 100644 --- a/docs/build.gradle +++ b/docs/build.gradle @@ -39,6 +39,9 @@ integTestCluster { setting 'reindex.remote.whitelist', '127.0.0.1:*' } +// remove when https://github.com/elastic/elasticsearch/issues/31305 is fixed +// !!! Do not merge to master +integTest.enabled = false // Build the cluster with all plugins project.rootProject.subprojects.findAll { it.parent.path == ':plugins' }.each { subproj -> From dbe3a0889e68ce2dba5b3d6bb424aae0c37032ae Mon Sep 17 00:00:00 2001 From: Alpar Torok Date: Thu, 21 Jun 2018 08:55:06 +0300 Subject: [PATCH 10/28] Only blacklist specific doc tests --- docs/build.gradle | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/build.gradle b/docs/build.gradle index ed53e5c7d32cd..a4e45b2685b8f 100644 --- a/docs/build.gradle +++ b/docs/build.gradle @@ -39,9 +39,13 @@ integTestCluster { setting 'reindex.remote.whitelist', '127.0.0.1:*' } -// remove when https://github.com/elastic/elasticsearch/issues/31305 is fixed -// !!! Do not merge to master -integTest.enabled = false +integTestRunner { + systemProperty 'tests.rest.blacklist', [ + // remove when https://github.com/elastic/elasticsearch/issues/31305 is fixed + 'plugins/ingest-attachment/line_164', + 'plugins/ingest-attachment/line_117' + ].join(',') +} // Build the cluster with all plugins project.rootProject.subprojects.findAll { it.parent.path == ':plugins' }.each { subproj -> From 6e10477c20c5f23de8f1aab9c535370e4ba28a65 Mon Sep 17 00:00:00 2001 From: Alpar Torok Date: Thu, 21 Jun 2018 09:02:39 +0300 Subject: [PATCH 11/28] Disable only failing tests in ingest attachment plugin --- plugins/ingest-attachment/build.gradle | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/plugins/ingest-attachment/build.gradle b/plugins/ingest-attachment/build.gradle index 1cfe4ed0c5c6e..f46c8066717ab 100644 --- a/plugins/ingest-attachment/build.gradle +++ b/plugins/ingest-attachment/build.gradle @@ -30,9 +30,14 @@ versions << [ 'mime4j': '0.8.1' ] -// disabled untill https://github.com/elastic/elasticsearch/issues/31456 -// is fixed. -integTest.enabled = false +integTestRunner { + // disabled untill https://github.com/elastic/elasticsearch/issues/31456 + // is fixed. + systemProperty 'tests.rest.blacklist', [ + 'ingest_attachment/20_attachment_processor/Test indexed chars are configurable', + 'ingest_attachment/20_attachment_processor/Test indexed chars are configurable per document' + ].join(',') +} dependencies { // mandatory for tika From aae11840ae9c90cabf05792a6cfbdce0233be85b Mon Sep 17 00:00:00 2001 From: Alpar Torok Date: Thu, 21 Jun 2018 13:01:00 +0300 Subject: [PATCH 12/28] Mute failing HDFS tests #31498 --- plugins/repository-hdfs/build.gradle | 15 +++++++++++++++ .../repositories/hdfs/HdfsTests.java | 1 + 2 files changed, 16 insertions(+) diff --git a/plugins/repository-hdfs/build.gradle b/plugins/repository-hdfs/build.gradle index 8856ae1526a21..ef635d67dffd6 100644 --- a/plugins/repository-hdfs/build.gradle +++ b/plugins/repository-hdfs/build.gradle @@ -214,6 +214,21 @@ RestIntegTestTask integTestSecureHa = project.tasks.create('integTestSecureHa', description = "Runs rest tests against an elasticsearch cluster with HDFS configured with HA Namenode and secured by MIT Kerberos." } +// TODO remove when: https://github.com/elastic/elasticsearch/issues/31498 +integTestRunner { + systemProperty 'tests.rest.blacklist', [ + 'hdfs_repository/30_snapshot/take snapshot', + 'hdfs_repository/40_restore/Create a snapshot and then restore it', + 'hdfs_repository/20_repository_verify/HDFS Repository Verify', + 'hdfs_repository/30_snapshot_get/Get a snapshot', + 'hdfs_repository/20_repository_create/HDFS Repository Creation', + 'hdfs_repository/20_repository_delete/HDFS Delete Repository', + 'hdfs_repository/30_snapshot_readonly/Get a snapshot - readonly', + ].join(',') +} +// TODO remove when: https://github.com/elastic/elasticsearch/issues/31498 +integTestHa.enabled = false + // Determine HDFS Fixture compatibility for the current build environment. boolean fixtureSupported = false if (Os.isFamily(Os.FAMILY_WINDOWS)) { diff --git a/plugins/repository-hdfs/src/test/java/org/elasticsearch/repositories/hdfs/HdfsTests.java b/plugins/repository-hdfs/src/test/java/org/elasticsearch/repositories/hdfs/HdfsTests.java index 9d0520205ed5b..d418c0629eda8 100644 --- a/plugins/repository-hdfs/src/test/java/org/elasticsearch/repositories/hdfs/HdfsTests.java +++ b/plugins/repository-hdfs/src/test/java/org/elasticsearch/repositories/hdfs/HdfsTests.java @@ -43,6 +43,7 @@ protected Collection> getPlugins() { return pluginList(HdfsPlugin.class); } + @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/31498") public void testSimpleWorkflow() { Client client = client(); From d7e299e6c3f738a1f46bb32ef95113f789c2c54e Mon Sep 17 00:00:00 2001 From: Alpar Torok Date: Thu, 21 Jun 2018 13:28:28 +0300 Subject: [PATCH 13/28] Mute failing lang-painless tests #31500 --- .../painless/ArrayLikeObjectTestCase.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/modules/lang-painless/src/test/java/org/elasticsearch/painless/ArrayLikeObjectTestCase.java b/modules/lang-painless/src/test/java/org/elasticsearch/painless/ArrayLikeObjectTestCase.java index 2f7c37e2f6939..c419f2133267d 100644 --- a/modules/lang-painless/src/test/java/org/elasticsearch/painless/ArrayLikeObjectTestCase.java +++ b/modules/lang-painless/src/test/java/org/elasticsearch/painless/ArrayLikeObjectTestCase.java @@ -92,19 +92,34 @@ private void expectOutOfBounds(int index, String script, Object val) { } } + @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/31500") public void testInts() { arrayLoadStoreTestCase(false, "int", 5, 6); } + @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/31500") public void testIntsInDef() { arrayLoadStoreTestCase(true, "int", 5, 6); } + @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/31500") public void testLongs() { arrayLoadStoreTestCase(false, "long", 5L, 6L); } + @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/31500") public void testLongsInDef() { arrayLoadStoreTestCase(true, "long", 5L, 6L); } + @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/31500") public void testShorts() { arrayLoadStoreTestCase(false, "short", (short) 5, (short) 6); } + @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/31500") public void testShortsInDef() { arrayLoadStoreTestCase(true, "short", (short) 5, (short) 6); } + @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/31500") public void testBytes() { arrayLoadStoreTestCase(false, "byte", (byte) 5, (byte) 6); } + @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/31500") public void testBytesInDef() { arrayLoadStoreTestCase(true, "byte", (byte) 5, (byte) 6); } + @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/31500") public void testFloats() { arrayLoadStoreTestCase(false, "float", 5.0f, 6.0f); } + @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/31500") public void testFloatsInDef() { arrayLoadStoreTestCase(true, "float", 5.0f, 6.0f); } + @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/31500") public void testDoubles() { arrayLoadStoreTestCase(false, "double", 5.0d, 6.0d); } + @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/31500") public void testDoublesInDef() { arrayLoadStoreTestCase(true, "double", 5.0d, 6.0d); } + @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/31500") public void testStrings() { arrayLoadStoreTestCase(false, "String", "cat", null); } + @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/31500") public void testStringsInDef() { arrayLoadStoreTestCase(true, "String", "cat", null); } + @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/31500") public void testDef() { arrayLoadStoreTestCase(true, "def", 5, null); } } From a7a49dbbb6be1ce43946ba7e4f7caa2a6cb778d7 Mon Sep 17 00:00:00 2001 From: Alpar Torok Date: Fri, 22 Jun 2018 09:18:02 +0300 Subject: [PATCH 14/28] Fix backwards compatability builds Fix JAVA version to 10 for ES 6.3 --- distribution/bwc/build.gradle | 2 ++ 1 file changed, 2 insertions(+) diff --git a/distribution/bwc/build.gradle b/distribution/bwc/build.gradle index 42412c6230fa4..9aabe33863ee1 100644 --- a/distribution/bwc/build.gradle +++ b/distribution/bwc/build.gradle @@ -153,6 +153,8 @@ subprojects { environment('JAVA_HOME', getJavaHome(it, 8)) } else if ("6.2".equals(bwcBranch)) { environment('JAVA_HOME', getJavaHome(it, 9)) + } else if ("6.3".equals(bwcBranch)) { + environment('JAVA_HOME', getJavaHome(it, 10)) } else { environment('JAVA_HOME', project.compilerJavaHome) } From da094bca10b94f20f497b21a2a8b7aeabb1c2787 Mon Sep 17 00:00:00 2001 From: Alpar Torok Date: Fri, 22 Jun 2018 09:50:16 +0300 Subject: [PATCH 15/28] Add 6.x to bwx -> java10 --- distribution/bwc/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/distribution/bwc/build.gradle b/distribution/bwc/build.gradle index 9aabe33863ee1..cae4411f4132d 100644 --- a/distribution/bwc/build.gradle +++ b/distribution/bwc/build.gradle @@ -153,7 +153,7 @@ subprojects { environment('JAVA_HOME', getJavaHome(it, 8)) } else if ("6.2".equals(bwcBranch)) { environment('JAVA_HOME', getJavaHome(it, 9)) - } else if ("6.3".equals(bwcBranch)) { + } else if (["6.3", "6.x"].contains(bwcBranch)) { environment('JAVA_HOME', getJavaHome(it, 10)) } else { environment('JAVA_HOME', project.compilerJavaHome) From 06763cc4ff777462be96587bbfd0e53d98c35fdf Mon Sep 17 00:00:00 2001 From: Alpar Torok Date: Fri, 22 Jun 2018 13:44:36 +0300 Subject: [PATCH 16/28] Prefix out and err from buildBwcVersion for readability ``` > Task :distribution:bwc:next-bugfix-snapshot:buildBwcVersion [bwc] :buildSrc:compileJava [bwc] WARNING: An illegal reflective access operation has occurred [bwc] WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass (file:/home/alpar/.gradle/wrapper/dists/gradle-4.5-all/cg9lyzfg3iwv6fa00os9gcgj4/gradle-4.5/lib/groovy-all-2.4.12.jar) to method java.lang.Object.finalize() [bwc] WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.reflection.CachedClass [bwc] WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations [bwc] WARNING: All illegal access operations will be denied in a future release [bwc] :buildSrc:compileGroovy [bwc] :buildSrc:writeVersionProperties [bwc] :buildSrc:processResources [bwc] :buildSrc:classes [bwc] :buildSrc:jar ``` --- distribution/bwc/build.gradle | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/distribution/bwc/build.gradle b/distribution/bwc/build.gradle index cae4411f4132d..c445a6346fc5e 100644 --- a/distribution/bwc/build.gradle +++ b/distribution/bwc/build.gradle @@ -22,6 +22,8 @@ import org.apache.tools.ant.taskdefs.condition.Os import org.elasticsearch.gradle.LoggedExec import org.elasticsearch.gradle.Version +import java.nio.charset.Charset + import static org.elasticsearch.gradle.BuildPlugin.getJavaHome /** @@ -179,6 +181,8 @@ subprojects { } else if (showStacktraceName.equals("ALWAYS_FULL")) { args "--full-stacktrace" } + standardOutput = new IdentingOutputStream(System.out) + errorOutput = new IdentingOutputStream(System.err) doLast { List missing = artifactFiles.grep { file -> false == file.exists() @@ -198,3 +202,25 @@ subprojects { } } } + +class IdentingOutputStream extends OutputStream { + + private final OutputStream delegate + + public IdentingOutputStream(OutputStream delegate) { + this.delegate = delegate + } + + @Override + public void write(int b) { + write([b] as int[], 0, 1) + } + + public void write(int[] bytes, int offset, int length) { + delegate.write( + new String(bytes, offset, length) + .replace("\n", "\n [bwc] ") + .getBytes(Charset.forName("UTF-8")) + ) + } +} \ No newline at end of file From 00d3b7e4e3eaef3695e93121c624bbe513624e78 Mon Sep 17 00:00:00 2001 From: Alpar Torok Date: Fri, 22 Jun 2018 15:02:02 +0300 Subject: [PATCH 17/28] Also set RUNTIME_JAVA_HOME for bwcBuild So that we can make sure it's not too new for the build to understand. --- distribution/bwc/build.gradle | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/distribution/bwc/build.gradle b/distribution/bwc/build.gradle index c445a6346fc5e..694b867eca51a 100644 --- a/distribution/bwc/build.gradle +++ b/distribution/bwc/build.gradle @@ -150,15 +150,20 @@ subprojects { task buildBwcVersion(type: Exec) { dependsOn checkoutBwcBranch, writeBuildMetadata workingDir = checkoutDir + // we are building branches that are officially built with JDK 8, push JAVA8_HOME to JAVA_HOME for these builds + // also send RUNTIME_JAVA_HOME so the build doesn't fails on newer version the branch doesn't know about if (["5.6", "6.0", "6.1"].contains(bwcBranch)) { - // we are building branches that are officially built with JDK 8, push JAVA8_HOME to JAVA_HOME for these builds environment('JAVA_HOME', getJavaHome(it, 8)) + environment('RUNTIME_JAVA_HOME', getJavaHome(it, 8)) } else if ("6.2".equals(bwcBranch)) { environment('JAVA_HOME', getJavaHome(it, 9)) + environment('RUNTIME_JAVA_HOME', getJavaHome(it, 9)) } else if (["6.3", "6.x"].contains(bwcBranch)) { environment('JAVA_HOME', getJavaHome(it, 10)) + environment('RUNTIME_JAVA_HOME', getJavaHome(it, 10)) } else { environment('JAVA_HOME', project.compilerJavaHome) + environment('RUNTIME_JAVA_HOME', project.compilerJavaHome) } if (Os.isFamily(Os.FAMILY_WINDOWS)) { executable 'cmd' From 1c19cf8df05b06d259b600467a3a5de82a304e0a Mon Sep 17 00:00:00 2001 From: Alpar Torok Date: Thu, 28 Jun 2018 09:29:31 +0300 Subject: [PATCH 18/28] Align bouncycastle dependency --- distribution/tools/plugin-cli/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/distribution/tools/plugin-cli/build.gradle b/distribution/tools/plugin-cli/build.gradle index 11663daf26be6..c47786299bc2f 100644 --- a/distribution/tools/plugin-cli/build.gradle +++ b/distribution/tools/plugin-cli/build.gradle @@ -24,7 +24,7 @@ archivesBaseName = 'elasticsearch-plugin-cli' dependencies { compileOnly "org.elasticsearch:elasticsearch:${version}" compileOnly "org.elasticsearch:elasticsearch-cli:${version}" - compile "org.bouncycastle:bcpg-jdk15on:1.58" + compile "org.bouncycastle:bcpg-jdk15on:1.59" compile "org.bouncycastle:bcprov-jdk15on:1.59" testCompile "org.elasticsearch.test:framework:${version}" testCompile 'com.google.jimfs:jimfs:1.1' From ef58e75a161417e02c1ace90010b54ff8038e309 Mon Sep 17 00:00:00 2001 From: Alpar Torok Date: Thu, 28 Jun 2018 10:32:04 +0300 Subject: [PATCH 19/28] fix painles array tets closes #31500 --- .../painless/ArrayLikeObjectTestCase.java | 15 --------------- .../org/elasticsearch/painless/ArrayTests.java | 7 ++++++- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/modules/lang-painless/src/test/java/org/elasticsearch/painless/ArrayLikeObjectTestCase.java b/modules/lang-painless/src/test/java/org/elasticsearch/painless/ArrayLikeObjectTestCase.java index c419f2133267d..2f7c37e2f6939 100644 --- a/modules/lang-painless/src/test/java/org/elasticsearch/painless/ArrayLikeObjectTestCase.java +++ b/modules/lang-painless/src/test/java/org/elasticsearch/painless/ArrayLikeObjectTestCase.java @@ -92,34 +92,19 @@ private void expectOutOfBounds(int index, String script, Object val) { } } - @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/31500") public void testInts() { arrayLoadStoreTestCase(false, "int", 5, 6); } - @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/31500") public void testIntsInDef() { arrayLoadStoreTestCase(true, "int", 5, 6); } - @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/31500") public void testLongs() { arrayLoadStoreTestCase(false, "long", 5L, 6L); } - @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/31500") public void testLongsInDef() { arrayLoadStoreTestCase(true, "long", 5L, 6L); } - @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/31500") public void testShorts() { arrayLoadStoreTestCase(false, "short", (short) 5, (short) 6); } - @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/31500") public void testShortsInDef() { arrayLoadStoreTestCase(true, "short", (short) 5, (short) 6); } - @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/31500") public void testBytes() { arrayLoadStoreTestCase(false, "byte", (byte) 5, (byte) 6); } - @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/31500") public void testBytesInDef() { arrayLoadStoreTestCase(true, "byte", (byte) 5, (byte) 6); } - @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/31500") public void testFloats() { arrayLoadStoreTestCase(false, "float", 5.0f, 6.0f); } - @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/31500") public void testFloatsInDef() { arrayLoadStoreTestCase(true, "float", 5.0f, 6.0f); } - @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/31500") public void testDoubles() { arrayLoadStoreTestCase(false, "double", 5.0d, 6.0d); } - @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/31500") public void testDoublesInDef() { arrayLoadStoreTestCase(true, "double", 5.0d, 6.0d); } - @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/31500") public void testStrings() { arrayLoadStoreTestCase(false, "String", "cat", null); } - @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/31500") public void testStringsInDef() { arrayLoadStoreTestCase(true, "String", "cat", null); } - @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/31500") public void testDef() { arrayLoadStoreTestCase(true, "def", 5, null); } } diff --git a/modules/lang-painless/src/test/java/org/elasticsearch/painless/ArrayTests.java b/modules/lang-painless/src/test/java/org/elasticsearch/painless/ArrayTests.java index 5c1141a49e557..86b17fb353142 100644 --- a/modules/lang-painless/src/test/java/org/elasticsearch/painless/ArrayTests.java +++ b/modules/lang-painless/src/test/java/org/elasticsearch/painless/ArrayTests.java @@ -20,6 +20,7 @@ package org.elasticsearch.painless; import org.apache.lucene.util.Constants; +import org.elasticsearch.bootstrap.JavaVersion; import org.hamcrest.Matcher; import java.lang.invoke.MethodHandle; @@ -41,7 +42,11 @@ protected String valueCtorCall(String valueType, int size) { @Override protected Matcher outOfBoundsExceptionMessageMatcher(int index, int size) { - return equalTo(Integer.toString(index)); + if (JavaVersion.current().compareTo(JavaVersion.parse("11")) < 0) { + return equalTo(Integer.toString(index)); + } else{ + return equalTo("Index " + Integer.toString(index) + " out of bounds for length " + Integer.toString(size)); + } } public void testArrayLengthHelper() throws Throwable { From b744d1ec893bbb91516a508be99bca822c7c8642 Mon Sep 17 00:00:00 2001 From: Alpar Torok Date: Thu, 28 Jun 2018 10:33:00 +0300 Subject: [PATCH 20/28] Update jar checksums --- .../tools/plugin-cli/licenses/bcpg-jdk15on-1.58.jar.sha1 | 1 - .../tools/plugin-cli/licenses/bcpg-jdk15on-1.59.jar.sha1 | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 distribution/tools/plugin-cli/licenses/bcpg-jdk15on-1.58.jar.sha1 create mode 100644 distribution/tools/plugin-cli/licenses/bcpg-jdk15on-1.59.jar.sha1 diff --git a/distribution/tools/plugin-cli/licenses/bcpg-jdk15on-1.58.jar.sha1 b/distribution/tools/plugin-cli/licenses/bcpg-jdk15on-1.58.jar.sha1 deleted file mode 100644 index dd66ae4cbe1a5..0000000000000 --- a/distribution/tools/plugin-cli/licenses/bcpg-jdk15on-1.58.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -b92c863d75bbdbfa88f08301cb243f406a58bec4 \ No newline at end of file diff --git a/distribution/tools/plugin-cli/licenses/bcpg-jdk15on-1.59.jar.sha1 b/distribution/tools/plugin-cli/licenses/bcpg-jdk15on-1.59.jar.sha1 new file mode 100644 index 0000000000000..0c0be50c906a3 --- /dev/null +++ b/distribution/tools/plugin-cli/licenses/bcpg-jdk15on-1.59.jar.sha1 @@ -0,0 +1 @@ +ee93e5376bb6cf0a15c027b5f5e4393f2738e709 \ No newline at end of file From ba87083a7a2a6b69d29f22da85d326d3056e5cb1 Mon Sep 17 00:00:00 2001 From: Alpar Torok Date: Fri, 29 Jun 2018 12:38:42 +0300 Subject: [PATCH 21/28] Keep 8/10 runtime/compile untill consensus builds on 11 --- .ci/java-versions.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.ci/java-versions.properties b/.ci/java-versions.properties index d13f1ea576c0f..a0713ce128e6f 100644 --- a/.ci/java-versions.properties +++ b/.ci/java-versions.properties @@ -4,5 +4,5 @@ # build and test Elasticsearch for this branch. Valid Java versions # are 'java' or 'openjdk' followed by the major release number. -ES_BUILD_JAVA=java11 -ES_RUNTIME_JAVA=java11 +ES_BUILD_JAVA=java10 +ES_RUNTIME_JAVA=java8 From fb056729de5458f9c2d800fe295b938c71e5d55b Mon Sep 17 00:00:00 2001 From: Alpar Torok Date: Mon, 2 Jul 2018 10:35:30 +0300 Subject: [PATCH 22/28] Only skip failing tests if running on Java 11 --- docs/build.gradle | 10 ++++--- plugins/ingest-attachment/build.gradle | 11 ++++---- .../attachment/AttachmentProcessorTests.java | 3 ++- plugins/repository-hdfs/build.gradle | 26 ++++++++++--------- .../repositories/hdfs/HdfsTests.java | 13 +++++----- 5 files changed, 35 insertions(+), 28 deletions(-) diff --git a/docs/build.gradle b/docs/build.gradle index a4e45b2685b8f..bc1fb2d29147d 100644 --- a/docs/build.gradle +++ b/docs/build.gradle @@ -39,12 +39,14 @@ integTestCluster { setting 'reindex.remote.whitelist', '127.0.0.1:*' } -integTestRunner { +// remove when https://github.com/elastic/elasticsearch/issues/31305 is fixed +if (rootProject.ext.runtimeJavaVersion.isJava11()) { + integTestRunner { systemProperty 'tests.rest.blacklist', [ - // remove when https://github.com/elastic/elasticsearch/issues/31305 is fixed - 'plugins/ingest-attachment/line_164', - 'plugins/ingest-attachment/line_117' + 'plugins/ingest-attachment/line_164', + 'plugins/ingest-attachment/line_117' ].join(',') + } } // Build the cluster with all plugins diff --git a/plugins/ingest-attachment/build.gradle b/plugins/ingest-attachment/build.gradle index f46c8066717ab..b2a8f0a64f0b5 100644 --- a/plugins/ingest-attachment/build.gradle +++ b/plugins/ingest-attachment/build.gradle @@ -30,13 +30,14 @@ versions << [ 'mime4j': '0.8.1' ] -integTestRunner { - // disabled untill https://github.com/elastic/elasticsearch/issues/31456 - // is fixed. +if (rootProject.ext.runtimeJavaVersion.isJava11()) { + // disabled until https://github.com/elastic/elasticsearch/issues/31456 is fixed. + integTestRunner { systemProperty 'tests.rest.blacklist', [ - 'ingest_attachment/20_attachment_processor/Test indexed chars are configurable', - 'ingest_attachment/20_attachment_processor/Test indexed chars are configurable per document' + 'ingest_attachment/20_attachment_processor/Test indexed chars are configurable', + 'ingest_attachment/20_attachment_processor/Test indexed chars are configurable per document' ].join(',') + } } dependencies { diff --git a/plugins/ingest-attachment/src/test/java/org/elasticsearch/ingest/attachment/AttachmentProcessorTests.java b/plugins/ingest-attachment/src/test/java/org/elasticsearch/ingest/attachment/AttachmentProcessorTests.java index b5d38fd294915..80ad1fbca875d 100644 --- a/plugins/ingest-attachment/src/test/java/org/elasticsearch/ingest/attachment/AttachmentProcessorTests.java +++ b/plugins/ingest-attachment/src/test/java/org/elasticsearch/ingest/attachment/AttachmentProcessorTests.java @@ -21,6 +21,7 @@ import org.apache.commons.io.IOUtils; import org.elasticsearch.ElasticsearchParseException; +import org.elasticsearch.bootstrap.JavaVersion; import org.elasticsearch.ingest.IngestDocument; import org.elasticsearch.ingest.Processor; import org.elasticsearch.ingest.RandomDocumentPicks; @@ -295,8 +296,8 @@ private Map parseDocument(String file, AttachmentProcessor proce return attachmentData; } - @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/31305") public void testIndexedChars() throws Exception { + assumeFalse("https://github.com/elastic/elasticsearch/issues/31305", JavaVersion.current().equals(JavaVersion.parse("11"))); processor = new AttachmentProcessor(randomAlphaOfLength(10), "source_field", "target_field", EnumSet.allOf(AttachmentProcessor.Property.class), 19, false, null); diff --git a/plugins/repository-hdfs/build.gradle b/plugins/repository-hdfs/build.gradle index ef635d67dffd6..9bf16ad948e6b 100644 --- a/plugins/repository-hdfs/build.gradle +++ b/plugins/repository-hdfs/build.gradle @@ -1,4 +1,4 @@ -/* +1/* * Licensed to Elasticsearch under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright @@ -214,20 +214,22 @@ RestIntegTestTask integTestSecureHa = project.tasks.create('integTestSecureHa', description = "Runs rest tests against an elasticsearch cluster with HDFS configured with HA Namenode and secured by MIT Kerberos." } -// TODO remove when: https://github.com/elastic/elasticsearch/issues/31498 -integTestRunner { +if (rootProject.ext.runtimeJavaVersion.isJava11()) { + // TODO remove when: https://github.com/elastic/elasticsearch/issues/31498 + integTestRunner { systemProperty 'tests.rest.blacklist', [ - 'hdfs_repository/30_snapshot/take snapshot', - 'hdfs_repository/40_restore/Create a snapshot and then restore it', - 'hdfs_repository/20_repository_verify/HDFS Repository Verify', - 'hdfs_repository/30_snapshot_get/Get a snapshot', - 'hdfs_repository/20_repository_create/HDFS Repository Creation', - 'hdfs_repository/20_repository_delete/HDFS Delete Repository', - 'hdfs_repository/30_snapshot_readonly/Get a snapshot - readonly', + 'hdfs_repository/30_snapshot/take snapshot', + 'hdfs_repository/40_restore/Create a snapshot and then restore it', + 'hdfs_repository/20_repository_verify/HDFS Repository Verify', + 'hdfs_repository/30_snapshot_get/Get a snapshot', + 'hdfs_repository/20_repository_create/HDFS Repository Creation', + 'hdfs_repository/20_repository_delete/HDFS Delete Repository', + 'hdfs_repository/30_snapshot_readonly/Get a snapshot - readonly', ].join(',') + } + // TODO remove when: https://github.com/elastic/elasticsearch/issues/31498 + integTestHa.enabled = false } -// TODO remove when: https://github.com/elastic/elasticsearch/issues/31498 -integTestHa.enabled = false // Determine HDFS Fixture compatibility for the current build environment. boolean fixtureSupported = false diff --git a/plugins/repository-hdfs/src/test/java/org/elasticsearch/repositories/hdfs/HdfsTests.java b/plugins/repository-hdfs/src/test/java/org/elasticsearch/repositories/hdfs/HdfsTests.java index d418c0629eda8..c328563b4b658 100644 --- a/plugins/repository-hdfs/src/test/java/org/elasticsearch/repositories/hdfs/HdfsTests.java +++ b/plugins/repository-hdfs/src/test/java/org/elasticsearch/repositories/hdfs/HdfsTests.java @@ -18,15 +18,11 @@ */ package org.elasticsearch.repositories.hdfs; -import static org.hamcrest.Matchers.equalTo; -import static org.hamcrest.Matchers.greaterThan; - -import java.util.Collection; - import com.carrotsearch.randomizedtesting.annotations.ThreadLeakFilters; import org.elasticsearch.action.admin.cluster.repositories.put.PutRepositoryResponse; import org.elasticsearch.action.admin.cluster.snapshots.create.CreateSnapshotResponse; import org.elasticsearch.action.admin.cluster.snapshots.restore.RestoreSnapshotResponse; +import org.elasticsearch.bootstrap.JavaVersion; import org.elasticsearch.client.Client; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.common.settings.Settings; @@ -35,6 +31,11 @@ import org.elasticsearch.snapshots.SnapshotState; import org.elasticsearch.test.ESSingleNodeTestCase; +import java.util.Collection; + +import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.greaterThan; + @ThreadLeakFilters(filters = {HdfsClientThreadLeakFilter.class}) public class HdfsTests extends ESSingleNodeTestCase { @@ -43,8 +44,8 @@ protected Collection> getPlugins() { return pluginList(HdfsPlugin.class); } - @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/31498") public void testSimpleWorkflow() { + assumeFalse("https://github.com/elastic/elasticsearch/issues/31498", JavaVersion.current().equals(JavaVersion.parse("11"))); Client client = client(); PutRepositoryResponse putRepositoryResponse = client.admin().cluster().preparePutRepository("test-repo") From cfc59237b9fddc328d6b3251b2a18b2c26c80a13 Mon Sep 17 00:00:00 2001 From: Alpar Torok Date: Mon, 2 Jul 2018 14:24:20 +0300 Subject: [PATCH 23/28] Failures are dependent of compile java version not runtime --- plugins/ingest-attachment/build.gradle | 2 +- plugins/repository-hdfs/build.gradle | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/ingest-attachment/build.gradle b/plugins/ingest-attachment/build.gradle index b2a8f0a64f0b5..1a6aa809de040 100644 --- a/plugins/ingest-attachment/build.gradle +++ b/plugins/ingest-attachment/build.gradle @@ -30,7 +30,7 @@ versions << [ 'mime4j': '0.8.1' ] -if (rootProject.ext.runtimeJavaVersion.isJava11()) { +if (rootProject.ext.compilerJavaVersion.isJava11()) { // disabled until https://github.com/elastic/elasticsearch/issues/31456 is fixed. integTestRunner { systemProperty 'tests.rest.blacklist', [ diff --git a/plugins/repository-hdfs/build.gradle b/plugins/repository-hdfs/build.gradle index 9bf16ad948e6b..45259791d064c 100644 --- a/plugins/repository-hdfs/build.gradle +++ b/plugins/repository-hdfs/build.gradle @@ -214,7 +214,7 @@ RestIntegTestTask integTestSecureHa = project.tasks.create('integTestSecureHa', description = "Runs rest tests against an elasticsearch cluster with HDFS configured with HA Namenode and secured by MIT Kerberos." } -if (rootProject.ext.runtimeJavaVersion.isJava11()) { +if (rootProject.ext.compilerJavaVersion.isJava11()) { // TODO remove when: https://github.com/elastic/elasticsearch/issues/31498 integTestRunner { systemProperty 'tests.rest.blacklist', [ From e6720b8b0eaafad4bb9c8fb949c485290411030c Mon Sep 17 00:00:00 2001 From: Alpar Torok Date: Mon, 2 Jul 2018 15:10:27 +0300 Subject: [PATCH 24/28] Condition doc test exceptions on compiler java version as well --- docs/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/build.gradle b/docs/build.gradle index ece20b12c72aa..829db4381b046 100644 --- a/docs/build.gradle +++ b/docs/build.gradle @@ -40,7 +40,7 @@ integTestCluster { } // remove when https://github.com/elastic/elasticsearch/issues/31305 is fixed -if (rootProject.ext.runtimeJavaVersion.isJava11()) { +if (rootProject.ext.compilerJavaVersion.isJava11()) { integTestRunner { systemProperty 'tests.rest.blacklist', [ 'plugins/ingest-attachment/line_164', From 41d97c12bc190ca10966c43a73b9bd2f77c10ada Mon Sep 17 00:00:00 2001 From: Alpar Torok Date: Mon, 2 Jul 2018 15:19:53 +0300 Subject: [PATCH 25/28] Disable hdfs tests based on runtime java --- plugins/repository-hdfs/build.gradle | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/repository-hdfs/build.gradle b/plugins/repository-hdfs/build.gradle index 45259791d064c..808b31ae1cd35 100644 --- a/plugins/repository-hdfs/build.gradle +++ b/plugins/repository-hdfs/build.gradle @@ -227,6 +227,8 @@ if (rootProject.ext.compilerJavaVersion.isJava11()) { 'hdfs_repository/30_snapshot_readonly/Get a snapshot - readonly', ].join(',') } +} +if (rootProject.ext.runtimeJavaVersion.isJava11()) { // TODO remove when: https://github.com/elastic/elasticsearch/issues/31498 integTestHa.enabled = false } From 188460aedf26b6e900bb03c7dbfd8837257eef62 Mon Sep 17 00:00:00 2001 From: Alpar Torok Date: Mon, 2 Jul 2018 16:04:16 +0300 Subject: [PATCH 26/28] Set runtime java to minimum supported for bwc --- distribution/bwc/build.gradle | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/distribution/bwc/build.gradle b/distribution/bwc/build.gradle index 694b867eca51a..d7584f9ffe4ca 100644 --- a/distribution/bwc/build.gradle +++ b/distribution/bwc/build.gradle @@ -149,21 +149,18 @@ subprojects { task buildBwcVersion(type: Exec) { dependsOn checkoutBwcBranch, writeBuildMetadata + // send RUNTIME_JAVA_HOME so the build doesn't fails on newer version the branch doesn't know about + environment('RUNTIME_JAVA_HOME', getJavaHome(it, rootProject.ext.minimumRuntimeVersion.getMajorVersion() as int)) workingDir = checkoutDir // we are building branches that are officially built with JDK 8, push JAVA8_HOME to JAVA_HOME for these builds - // also send RUNTIME_JAVA_HOME so the build doesn't fails on newer version the branch doesn't know about if (["5.6", "6.0", "6.1"].contains(bwcBranch)) { environment('JAVA_HOME', getJavaHome(it, 8)) - environment('RUNTIME_JAVA_HOME', getJavaHome(it, 8)) } else if ("6.2".equals(bwcBranch)) { environment('JAVA_HOME', getJavaHome(it, 9)) - environment('RUNTIME_JAVA_HOME', getJavaHome(it, 9)) } else if (["6.3", "6.x"].contains(bwcBranch)) { environment('JAVA_HOME', getJavaHome(it, 10)) - environment('RUNTIME_JAVA_HOME', getJavaHome(it, 10)) } else { environment('JAVA_HOME', project.compilerJavaHome) - environment('RUNTIME_JAVA_HOME', project.compilerJavaHome) } if (Os.isFamily(Os.FAMILY_WINDOWS)) { executable 'cmd' From 6d9fb3f5643b5ea1eee32a4fd41215aa4bbd52cb Mon Sep 17 00:00:00 2001 From: Alpar Torok Date: Tue, 3 Jul 2018 18:12:24 +0300 Subject: [PATCH 27/28] PR review --- distribution/bwc/build.gradle | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/distribution/bwc/build.gradle b/distribution/bwc/build.gradle index d7584f9ffe4ca..b84bf1df2fe8e 100644 --- a/distribution/bwc/build.gradle +++ b/distribution/bwc/build.gradle @@ -18,14 +18,14 @@ */ + import org.apache.tools.ant.taskdefs.condition.Os import org.elasticsearch.gradle.LoggedExec import org.elasticsearch.gradle.Version -import java.nio.charset.Charset +import java.nio.charset.StandardCharsets import static org.elasticsearch.gradle.BuildPlugin.getJavaHome - /** * This is a dummy project which does a local checkout of the previous * wire compat version's branch, and builds a snapshot. This allows backcompat @@ -183,8 +183,8 @@ subprojects { } else if (showStacktraceName.equals("ALWAYS_FULL")) { args "--full-stacktrace" } - standardOutput = new IdentingOutputStream(System.out) - errorOutput = new IdentingOutputStream(System.err) + standardOutput = new IndentingOutputStream(System.out) + errorOutput = new IndentingOutputStream(System.err) doLast { List missing = artifactFiles.grep { file -> false == file.exists() @@ -205,11 +205,12 @@ subprojects { } } -class IdentingOutputStream extends OutputStream { +class IndentingOutputStream extends OutputStream { + public static final byte[] INDENT = " [bwc] ".getBytes(StandardCharsets.UTF_8) private final OutputStream delegate - public IdentingOutputStream(OutputStream delegate) { + public IndentingOutputStream(OutputStream delegate) { this.delegate = delegate } @@ -219,10 +220,11 @@ class IdentingOutputStream extends OutputStream { } public void write(int[] bytes, int offset, int length) { - delegate.write( - new String(bytes, offset, length) - .replace("\n", "\n [bwc] ") - .getBytes(Charset.forName("UTF-8")) - ) + for (int i = 0; i < bytes.length; i++) { + delegate.write(bytes[i]) + if (bytes[i] == '\n') { + delegate.write(INDENT) + } + } } } \ No newline at end of file From 13f536b2ddf0f757dd9db331892521b61f060fed Mon Sep 17 00:00:00 2001 From: Alpar Torok Date: Wed, 4 Jul 2018 08:23:42 +0300 Subject: [PATCH 28/28] Add comment with ticket for forbidden apis --- buildSrc/src/main/resources/forbidden/jdk-signatures.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/buildSrc/src/main/resources/forbidden/jdk-signatures.txt b/buildSrc/src/main/resources/forbidden/jdk-signatures.txt index 4ed683218f4d6..3ae2e4b609427 100644 --- a/buildSrc/src/main/resources/forbidden/jdk-signatures.txt +++ b/buildSrc/src/main/resources/forbidden/jdk-signatures.txt @@ -88,6 +88,8 @@ java.lang.Thread#getAllStackTraces() @defaultMessage Stopping threads explicitly leads to inconsistent states. Use interrupt() instead. java.lang.Thread#stop() +# uncomment when https://github.com/elastic/elasticsearch/issues/31715 is fixed +# java.lang.Thread#stop(java.lang.Throwable) @defaultMessage Please do not terminate the application java.lang.System#exit(int)