Skip to content
This repository has been archived by the owner on Jan 2, 2023. It is now read-only.

Commit

Permalink
Add a test for how the sending of queued messages has changed
Browse files Browse the repository at this point in the history
  • Loading branch information
iconara committed Sep 28, 2014
1 parent d50c26a commit 7fbf89d
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions spec/cql/protocol/cql_protocol_handler_spec.rb
Expand Up @@ -248,6 +248,27 @@ module Protocol
128.times { |i| connection.data_listener.call([0x81, 0, i, 2, 0].pack('C4N')) }
write_count.should == 128
end

it 'does not stop sending queued requests even when one has timed out' do
write_count = 0
connection.stub(:write) do |s, &h|
write_count += 1
if h
h.call(buffer)
else
buffer << s
end
end
128.times do
protocol_handler.send_request(request)
end
scheduler.stub(:schedule_timer).with(5).and_return(timer_promise.future)
f1 = protocol_handler.send_request(request, 5)
f2 = protocol_handler.send_request(request)
timer_promise.fulfill
connection.data_listener.call([0x81, 0, 0, 2, 0].pack('C4N'))
write_count.should == 129
end
end
end

Expand Down

0 comments on commit 7fbf89d

Please sign in to comment.