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

Method test_failpoints

tests/failure/test_failpoints.py:95–126  ·  view source on GitHub ↗
(self, vector)

Source from the content-addressed store, hash-verified

93 # killer on machines with 30GB RAM. This makes the test run in 4 minutes instead of 1-2.
94 @pytest.mark.execute_serially
95 def test_failpoints(self, vector):
96 db_name = ImpalaTestSuite.get_db_name_from_format(vector.get_table_format())
97 query = vector.get_value('query').format(db=db_name)
98 action = vector.get_value('action')
99 location = vector.get_value('location')
100 vector.get_value('exec_option')['mt_dop'] = vector.get_value('mt_dop')
101
102 plan_node_ids = self.__parse_plan_nodes_from_explain(query, vector)
103 for node_id in plan_node_ids:
104 debug_action = '%d:%s:%s' % (node_id, location, FAILPOINT_ACTION_MAP[action])
105 # IMPALA-7046: add jitter to backend startup to exercise various failure paths.
106 debug_action += '|COORD_BEFORE_EXEC_RPC:JITTER@100@0.3'
107
108 LOG.info('Current debug action: SET DEBUG_ACTION=%s' % debug_action)
109 vector.get_value('exec_option')['debug_action'] = debug_action
110
111 if action == 'CANCEL':
112 self.__execute_cancel_action(query, vector)
113 elif action == 'FAIL' or action == 'MEM_LIMIT_EXCEEDED':
114 self.__execute_fail_action(query, vector)
115 else:
116 assert 0, 'Unknown action: %s' % action
117
118 # We should be able to execute the same query successfully when no failures are
119 # injected.
120 del vector.get_value('exec_option')['debug_action']
121 self.execute_query(query, vector.get_value('exec_option'))
122
123 # Detect any hung fragments left from this test.
124 for impalad in ImpalaCluster.get_e2e_test_cluster().impalads:
125 verifier = MetricVerifier(impalad.service)
126 verifier.wait_for_metric("impala-server.num-fragments-in-flight", 0)
127
128 def __parse_plan_nodes_from_explain(self, query, vector):
129 """Parses the EXPLAIN <query> output and returns a list of node ids.

Callers

nothing calls this directly

Calls 11

__execute_fail_actionMethod · 0.95
wait_for_metricMethod · 0.95
MetricVerifierClass · 0.90
get_table_formatMethod · 0.80
get_e2e_test_clusterMethod · 0.80
formatMethod · 0.45
get_valueMethod · 0.45
execute_queryMethod · 0.45

Tested by

no test coverage detected