Skip to content

Commit cf25e24

Browse files
committed
Fix test cases
1 parent 74bc2ba commit cf25e24

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

spec/statement_client_spec.rb

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,12 +540,21 @@
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
@@ -602,12 +611,21 @@
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

0 commit comments

Comments
 (0)