mirror of
https://github.com/apache/impala.git
synced 2026-01-07 00:02:28 -05:00
A failed test case inside a test file will leave the rest of the test cases in the file unexecuted. Some test cases may modify some query options such as memory limit and then restore them in the subsequent test cases in the same file. The failure of those test cases will leave the query options modified, causing cascading failures to other test cases which aren't expected to be run with the modified query options (e.g. lowered memory limit). This problem may lead to broken builds which are recorded in IMPALA-2724 and IMPALA-2824. This change fixes the problem above by checking if a test case modifies any query option and if so, restore those modified query options to their default values. This change makes the assumption that a test should not modify an option specified in its test vector so it's safe to restore the modified query options to their default values. Change-Id: Ib88d1dcb6a65183e1afc8eef0c764179a9f6a8ce Reviewed-on: http://gerrit.cloudera.org:8080/1774 Reviewed-by: Michael Ho <kwho@cloudera.com> Tested-by: Internal Jenkins
39 lines
1.4 KiB
Python
39 lines
1.4 KiB
Python
# Copyright (c) 2014 Cloudera, Inc. All rights reserved.
|
|
#
|
|
# Licensed 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.
|
|
#
|
|
# Tests for SET <query option>
|
|
|
|
import logging
|
|
import pytest
|
|
from tests.beeswax.impala_beeswax import ImpalaBeeswaxException
|
|
from tests.common.test_dimensions import *
|
|
from tests.common.impala_test_suite import ImpalaTestSuite, SINGLE_NODE_ONLY
|
|
|
|
class TestSet(ImpalaTestSuite):
|
|
@classmethod
|
|
def get_workload(self):
|
|
return 'functional-query'
|
|
|
|
@classmethod
|
|
def add_test_dimensions(cls):
|
|
super(TestSet, cls).add_test_dimensions()
|
|
# This test only needs to be run once.
|
|
cls.TestMatrix.add_dimension(create_single_exec_option_dimension())
|
|
cls.TestMatrix.add_dimension(create_uncompressed_text_dimension(cls.get_workload()))
|
|
|
|
def test_set(self, vector):
|
|
# Please note that query options modified during the test will be reset
|
|
# at the end of each test.
|
|
self.run_test_case('QueryTest/set', vector)
|