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)
| 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): |
nothing calls this directly
no test coverage detected