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

Method test_cancellation

tests/shell/test_shell_commandline.py:604–618  ·  view source on GitHub ↗

Test cancellation (Ctrl+C event). Run a query that sleeps 10ms per row so will run for 110s if not cancelled, but will detect cancellation quickly because of the small batch size.

(self, vector)

Source from the content-addressed store, hash-verified

602 assert impalad_service.wait_for_num_in_flight_queries(0)
603
604 def test_cancellation(self, vector):
605 """Test cancellation (Ctrl+C event). Run a query that sleeps 10ms per row so will run
606 for 110s if not cancelled, but will detect cancellation quickly because of the small
607 batch size."""
608 if vector.get_value('strict_hs2_protocol'):
609 pytest.skip("IMPALA-10827: Message not reported in strict hs2 mode.")
610 query = "set num_nodes=1; set mt_dop=1; set batch_size=1; \
611 select sleep(10) from functional_parquet.alltypesagg"
612 p = ImpalaShell(vector, ['-q', query])
613 try:
614 p.wait_for_query_start()
615 finally:
616 os.kill(p.pid(), signal.SIGINT)
617 result = p.get_result()
618 assert "Cancelling Query" in result.stderr, result.stderr
619
620 @pytest.mark.execute_serially
621 def test_query_cancellation_during_fetch(self, vector):

Callers

nothing calls this directly

Calls 7

wait_for_query_startMethod · 0.95
pidMethod · 0.95
get_resultMethod · 0.95
ImpalaShellClass · 0.90
skipMethod · 0.80
get_valueMethod · 0.45
killMethod · 0.45

Tested by

no test coverage detected