Michael Smith has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/22018 )

Change subject: IMPALA-13510: Unset the environment variable for tuple cache 
tests
......................................................................


Patch Set 1:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/22018/1/tests/custom_cluster/test_tuple_cache.py
File tests/custom_cluster/test_tuple_cache.py:

http://gerrit.cloudera.org:8080/#/c/22018/1/tests/custom_cluster/test_tuple_cache.py@108
PS1, Line 108:     os.unsetenv("TUPLE_CACHE_DIR")
> I tested to add a second class TestTupleCache1 after test class TestTupleCa
I ran a similar experiment and get a different result. I moved unsetenv out of 
TestTupleCacheBase, and set TUPLE_CACHE_DIR externally, then ran

  class TestTupleCache(TestTupleCacheBase):
    @classmethod
    def setup_class(cls):
      super(TestTupleCache, cls).setup_class()
      # Unset this environment variable to ensure it doesn't affect
      # the test like test_cache_disabled.
      os.unsetenv("TUPLE_CACHE_DIR")

    @CustomClusterTestSuite.with_args(cluster_size=1)
    @pytest.mark.execute_serially
    def test_cache_disabled(self, vector, unique_database):
      self.client.set_configuration(vector.get_value('exec_option'))
      fq_table = "{0}.cache_disabled".format(unique_database)
      self.create_table(fq_table)
      result1 = self.execute_query("SELECT * from {0}".format(fq_table))
      result2 = self.execute_query("SELECT * from {0}".format(fq_table))

      assert result1.success
      assert result2.success
      assert result1.data == result2.data
      assertCounters(result1.runtime_profile, num_hits=0, num_halted=0, 
num_skipped=1)
      assertCounters(result2.runtime_profile, num_hits=0, num_halted=0, 
num_skipped=1)

  class TestTupleCache2(TestTupleCacheBase):
    @CustomClusterTestSuite.with_args(cluster_size=1)
    @pytest.mark.execute_serially
    def test_cache_disabled(self, vector, unique_database):
      self.client.set_configuration(vector.get_value('exec_option'))
      fq_table = "{0}.cache_disabled".format(unique_database)
      self.create_table(fq_table)
      result1 = self.execute_query("SELECT * from {0}".format(fq_table))
      result2 = self.execute_query("SELECT * from {0}".format(fq_table))

      assert result1.success
      assert result2.success
      assert result1.data == result2.data
      assertCounters(result1.runtime_profile, num_hits=0, num_halted=0, 
num_skipped=1)
      assertCounters(result2.runtime_profile, num_hits=0, num_halted=0, 
num_skipped=1)

Both tests passed, when the 2nd should fail. I also added breakpoints and 
inspected the result of os.system('printenv TUPLE_CACHE_DIR'), and the setting 
persisted to other test classes.



--
To view, visit http://gerrit.cloudera.org:8080/22018
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I2b551e533c7c69d5b29ed6ad6af90be57f53c937
Gerrit-Change-Number: 22018
Gerrit-PatchSet: 1
Gerrit-Owner: Yida Wu <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Joe McDonnell <[email protected]>
Gerrit-Reviewer: Kurt Deschler <[email protected]>
Gerrit-Reviewer: Michael Smith <[email protected]>
Gerrit-Reviewer: Yida Wu <[email protected]>
Gerrit-Comment-Date: Tue, 05 Nov 2024 17:45:14 +0000
Gerrit-HasComments: Yes

Reply via email to