MCPcopy Create free account
hub / github.com/apache/impala / test_report_time

Method test_report_time

tests/query_test/test_observability.py:77–100  ·  view source on GitHub ↗

Regression test for IMPALA-6741 - checks that last reporting time exists in profiles of fragment instances.

(self)

Source from the content-addressed store, hash-verified

75 assert exchange['peak_mem'] > 0
76
77 def test_report_time(self):
78 """ Regression test for IMPALA-6741 - checks that last reporting time exists in
79 profiles of fragment instances."""
80 query = """select count(distinct a.int_col) from functional.alltypes a
81 inner join functional.alltypessmall b on (a.id = b.id + cast(sleep(15) as INT))"""
82 handle = self.hs2_client.execute_async(query)
83
84 num_validated = 0
85 tree = self.hs2_client.get_runtime_profile(handle, TRuntimeProfileFormat.THRIFT)
86 while not self.hs2_client.state_is_finished(handle):
87 assert tree, num_validated
88 for node in tree.nodes:
89 if node.name.startswith('Instance '):
90 info_strings_key = 'Last report received time'
91 assert info_strings_key in node.info_strings
92 report_time_str = node.info_strings[info_strings_key].split(".")[0]
93 # Try converting the string to make sure it's in the expected format
94 assert datetime.strptime(report_time_str, '%Y-%m-%d %H:%M:%S')
95 num_validated += 1
96 tree = self.hs2_client.get_runtime_profile(handle, TRuntimeProfileFormat.THRIFT)
97 # Let's not hit the backend too hard
98 sleep(0.1)
99 assert num_validated > 0
100 self.hs2_client.close_query(handle)
101
102 @SkipIfFS.hbase
103 def test_scan_summary(self):

Callers

nothing calls this directly

Calls 4

execute_asyncMethod · 0.45
get_runtime_profileMethod · 0.45
state_is_finishedMethod · 0.45
close_queryMethod · 0.45

Tested by

no test coverage detected