File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 540540 client . advance
541541
542542 sleep 1
543+
543544 stub_request ( :get , "localhost/v1/next_uri" ) .
544545 with ( headers : headers ) .
545546 to_return ( body : planning_response . to_json )
547+
548+ cancel = stub_request ( :delete , "localhost/v1/next_uri" ) .
549+ with ( headers : headers ) .
550+ to_return ( status : 204 ) # NoContent
551+
546552 expect do
547553 client . advance
548554 end . to raise_error ( Trino ::Client ::TrinoQueryTimeoutError , "Query queryid timed out" )
555+
556+ expect ( cancel ) . to have_been_requested
557+ expect ( client . client_error? ) . to eq true
549558 end
550559
551560 it "raises TrinoQueryTimeoutError if timeout during initial resuming" do
602611 client . advance
603612
604613 sleep 1
614+
605615 stub_request ( :get , "localhost/v1/next_uri" ) .
606616 with ( headers : headers ) .
607617 to_return ( body : late_running_response . to_json )
618+
619+ cancel = stub_request ( :delete , "localhost/v1/next_uri" ) .
620+ with ( headers : headers ) .
621+ to_return ( status : 204 ) # NoContent
622+
608623 expect do
609624 client . advance
610625 end . to raise_error ( Trino ::Client ::TrinoQueryTimeoutError , "Query queryid timed out" )
626+
627+ expect ( cancel ) . to have_been_requested
628+ expect ( client . client_error? ) . to eq true
611629 end
612630
613631 it "doesn't raise errors if query is done" do
You can’t perform that action at this time.
0 commit comments