mirror of
https://github.com/apache/impala.git
synced 2025-12-20 18:37:21 -05:00
The test 'test_jvm_pause_monitor_logs_entries' stops and starts an impalad, and confirms that that the JVM pause monitor detects the pause by looking for a specific message in the log. In a test run the test failed to find the correct message after sleeping for 1.2 seconds. Because the test notes the last message that it sees in the log, we can observe that the test would have found the correct message if it had waited for just a few more milliseconds. This change increases the time that the test waits to 2 seconds. TESTING: Ran end-to-end tests cleanly and checked that test_jvm_pause_monitor_logs_entries ran OK. Change-Id: I735c0c0ecfd3a9099c9cef332c5e79854bec7b8d Reviewed-on: http://gerrit.cloudera.org:8080/12475 Reviewed-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com> Tested-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>
43 lines
1.8 KiB
Python
43 lines
1.8 KiB
Python
# Licensed to the Apache Software Foundation (ASF) under one
|
|
# or more contributor license agreements. See the NOTICE file
|
|
# distributed with this work for additional information
|
|
# regarding copyright ownership. The ASF licenses this file
|
|
# to you under the Apache License, Version 2.0 (the
|
|
# "License"); you may not use this file except in compliance
|
|
# with the License. You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing,
|
|
# software distributed under the License is distributed on an
|
|
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
# KIND, either express or implied. See the License for the
|
|
# specific language governing permissions and limitations
|
|
# under the License.
|
|
|
|
import signal
|
|
import time
|
|
|
|
from tests.common.custom_cluster_test_suite import CustomClusterTestSuite
|
|
|
|
|
|
class TestPauseMonitor(CustomClusterTestSuite):
|
|
"""Class for pause monitor tests."""
|
|
|
|
@CustomClusterTestSuite.with_args("--logbuflevel=-1")
|
|
def test_jvm_pause_monitor_logs_entries(self):
|
|
"""This test injects a non-GC pause and confirms that that the JVM pause
|
|
monitor detects and logs it."""
|
|
impalad = self.cluster.get_first_impalad()
|
|
# Send a SIGSTOP for the process and block it for 5s.
|
|
impalad.kill(signal.SIGSTOP)
|
|
time.sleep(5)
|
|
impalad.kill(signal.SIGCONT)
|
|
# Wait for over a second for the cache metrics to expire.
|
|
time.sleep(2)
|
|
# Check that the pause is detected.
|
|
self.assert_impalad_log_contains('INFO', "Detected pause in JVM or host machine")
|
|
# Check that the metrics we have for this updated as well
|
|
assert impalad.service.get_metric_value("jvm.gc_num_info_threshold_exceeded") > 0
|
|
assert impalad.service.get_metric_value("jvm.gc_total_extra_sleep_time_millis") > 0
|