From 268d5ba97a31bf727e13743a5ad1b85b95ce2294 Mon Sep 17 00:00:00 2001 From: Tanguy Leroux Date: Mon, 24 Oct 2016 09:30:55 +0200 Subject: [PATCH] Add JVM option "-XX:-AssumeMP" in SystemD tests (#21063) Since with j`ava-1.8.0-openjdk-1.8.0.111-1.b15.el7_2.x86_64`, the OpenJDK packaged for CentOS and OEL override the default value (`false`) for the JVM option `AssumeMP` and force it to `true` (see [this patch](https://git.centos.org/blob/rpms!!java-1.8.0-openjdk.git/ab03fcc7a277355a837dd4c8500f8f90201ea353/SOURCES!always_assumemp.patch)) Because it is forced to true by default for these packages, the following warning message is printed to the standard output when the Vagrant box has only 1 CPU: > OpenJDK 64-Bit Server VM warning: If the number of processors is expected to increase from one, then you should configure the number of parallel GC threads appropriately using -XX:ParallelGCThreads=N This message will then fail the test introduced in #20422 where we check if no entries have been added to the journal after the service has been started. This commit restore the default value for the `AssumeMP` option for CentOS and OracleServer. --- .../packaging/scripts/60_systemd.bats | 29 ++++++++++++++++--- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/qa/vagrant/src/test/resources/packaging/scripts/60_systemd.bats b/qa/vagrant/src/test/resources/packaging/scripts/60_systemd.bats index fefd10f1be0..de1416059dd 100644 --- a/qa/vagrant/src/test/resources/packaging/scripts/60_systemd.bats +++ b/qa/vagrant/src/test/resources/packaging/scripts/60_systemd.bats @@ -73,6 +73,26 @@ setup() { run date +%s epoch="$output" + # The OpenJDK packaged for CentOS and OEL both override the default value (false) for the JVM option "AssumeMP". + # + # Because it is forced to "true" by default for these packages, the following warning message is printed to the + # standard output when the Vagrant box has only 1 CPU: + # OpenJDK 64-Bit Server VM warning: If the number of processors is expected to increase from one, then you should configure + # the number of parallel GC threads appropriately using -XX:ParallelGCThreads=N + # + # This message will then fail the next test where we check if no entries have been added to the journal. + # + # This message appears since with java-1.8.0-openjdk-1.8.0.111-1.b15.el7_2.x86_64 because of the commit: + # 2016-10-10 - Andrew Hughes - 1:1.8.0.111-1.b15 - Turn debug builds on for all JIT architectures. + # Always AssumeMP on RHEL. + # - Resolves: rhbz#1381990 + # + # Here we set the "-XX:-AssumeMP" option to false again: + lsb_release=$(lsb_release -i) + if [[ "$lsb_release" =~ "CentOS" ]] || [[ "$lsb_release" =~ "OracleServer" ]]; then + echo "-XX:-AssumeMP" >> $ESCONFIG/jvm.options + fi + systemctl start elasticsearch.service wait_for_elasticsearch_status assert_file_exist "/var/run/elasticsearch/elasticsearch.pid" @@ -85,10 +105,11 @@ setup() { # Verifies that no new entries in journald have been added # since the last start result="$(journalctl _SYSTEMD_UNIT=elasticsearch.service --since "$since" --output cat | wc -l)" - # This check is muted because OpenJDK jdk8u111-b15 now prints a warning message at startup: - # OpenJDK 64-Bit Server VM warning: If the number of processors is expected to increase from one, then you should configure - # the number of parallel GC threads appropriately using -XX:ParallelGCThreads=N - #[ "$result" -eq "0" ] + [ "$result" -eq "0" ] || { + echo "Expected no entries in journalctl for the Elasticsearch service but found:" + journalctl _SYSTEMD_UNIT=elasticsearch.service --since "$since" + false + } } @test "[SYSTEMD] start (running)" {