Skip to content

Commit b89491e

Browse files
authored
Fix openjdk use for package test (elastic#41277)
The gc log filename on linux is different with openjdk vs the oracle openjdk. This commit fixes the filename checked, which has changed because we now use oracle's openjdk 11. Additionally, windows packaging tests are fixed to download openjdk 11, and use it.
1 parent 5375465 commit b89491e

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

Vagrantfile

+7-5
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,6 @@ Vagrant.configure(2) do |config|
6464
SHELL
6565
end
6666
end
67-
# Wheezy's backports don't contain Openjdk 8 and the backflips
68-
# required to get the sun jdk on there just aren't worth it. We have
69-
# jessie and stretch for testing debian and it works fine.
7067
'debian-8'.tap do |box|
7168
config.vm.define box, define_opts do |config|
7269
config.vm.box = 'elastic/debian-8-x86_64'
@@ -406,11 +403,16 @@ def windows_common(config, name)
406403
$ps_prompt | Out-File $PsHome/Microsoft.PowerShell_profile.ps1
407404
SHELL
408405

406+
config.vm.provision 'windows-jdk-11', type: 'shell', inline: <<-SHELL
407+
New-Item -ItemType Directory -Force -Path "C:/java"
408+
Invoke-WebRequest "https://download.java.net/java/GA/jdk11/9/GPL/openjdk-11.0.2_windows-x64_bin.zip" -OutFile "C:/java/jdk-11.zip"
409+
Expand-Archive -Path "C:/java/jdk-11.zip" -DestinationPath "C:/java/"
410+
SHELL
411+
409412
config.vm.provision 'set env variables', type: 'shell', inline: <<-SHELL
410413
$ErrorActionPreference = "Stop"
411414
[Environment]::SetEnvironmentVariable("PACKAGING_ARCHIVES", "C:/project/build/packaging/archives", "Machine")
412-
$javaHome = [Environment]::GetEnvironmentVariable("JAVA_HOME", "Machine")
413-
[Environment]::SetEnvironmentVariable("SYSTEM_JAVA_HOME", $javaHome, "Machine")
415+
[Environment]::SetEnvironmentVariable("SYSTEM_JAVA_HOME", "C:\java\jdk-11.0.2", "Machine")
414416
[Environment]::SetEnvironmentVariable("PACKAGING_TESTS", "C:/project/build/packaging/tests", "Machine")
415417
[Environment]::SetEnvironmentVariable("JAVA_HOME", $null, "Machine")
416418
SHELL

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ class VagrantTestPlugin implements Plugin<Project> {
300300
} else {
301301
\$testArgs = \$args
302302
}
303-
"\$Env:SYSTEM_JAVA_HOME"/bin/java -cp "\$Env:PACKAGING_TESTS/*" org.elasticsearch.packaging.VMTestRunner @testArgs
303+
& "\$Env:SYSTEM_JAVA_HOME"/bin/java -cp "\$Env:PACKAGING_TESTS/*" org.elasticsearch.packaging.VMTestRunner @testArgs
304304
exit \$LASTEXITCODE
305305
"""
306306
}

qa/vagrant/src/test/resources/packaging/tests/70_sysv_initd.bats

+1-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ setup() {
160160

161161
@test "[INIT.D] GC logs exist" {
162162
start_elasticsearch_service
163-
assert_file_exist /var/log/elasticsearch/gc.log.0.current
163+
assert_file_exist /var/log/elasticsearch/gc.log
164164
stop_elasticsearch_service
165165
}
166166

0 commit comments

Comments
 (0)