This test scans the same table twice and verifies the cache hit count metrics are correct. The exact number of bytes hit is non-deterministic between runs due to different mtime of files and multiple shards in the cache.
(self)
| 104 | self.__test_data_cache_deterministic(vector, unique_database) |
| 105 | |
| 106 | def __test_data_cache(self): |
| 107 | """ This test scans the same table twice and verifies the cache hit count metrics |
| 108 | are correct. The exact number of bytes hit is non-deterministic between runs due |
| 109 | to different mtime of files and multiple shards in the cache. |
| 110 | """ |
| 111 | QUERY = "select * from tpch_parquet.lineitem" |
| 112 | # Do a first run to warm up the cache. Expect no hits. |
| 113 | self.execute_query(QUERY) |
| 114 | assert self.get_data_cache_metric('hit-bytes') == 0 |
| 115 | assert self.get_data_cache_metric('hit-count') == 0 |
| 116 | assert self.get_data_cache_metric('miss-bytes') > 0 |
| 117 | assert self.get_data_cache_metric('miss-count') > 0 |
| 118 | assert self.get_data_cache_metric('total-bytes') > 0 |
| 119 | assert self.get_data_cache_metric('num-entries') > 0 |
| 120 | assert self.get_data_cache_metric('num-writes') > 0 |
| 121 | |
| 122 | # Do a second run. Expect some hits. |
| 123 | self.execute_query(QUERY) |
| 124 | assert self.get_data_cache_metric('hit-bytes') > 0 |
| 125 | assert self.get_data_cache_metric('hit-count') > 0 |
| 126 | |
| 127 | @pytest.mark.execute_serially |
| 128 | @CustomClusterTestSuite.with_args( |
no test coverage detected