Skip to content

Commit fa25549

Browse files
committed
attempt at more robust spec
1 parent eb9895d commit fa25549

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

spec/mongo/server/connection_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -323,11 +323,11 @@
323323
it "closes the socket and does not use it for subsequent requests" do
324324
t = Thread.new {
325325
# Kill the thread just before the reply is read
326-
allow(Mongo::Protocol::Reply).to receive(:deserialize) { t.kill }
326+
allow(Mongo::Protocol::Reply).to receive(:deserialize_header) { t.kill }
327327
connection.dispatch([ query_bob ])
328328
}
329-
t.join(2)
330-
allow(Mongo::Protocol::Reply).to receive(:deserialize).and_call_original
329+
t.join
330+
allow(Mongo::Protocol::Reply).to receive(:deserialize_header).and_call_original
331331
expect(connection.dispatch([ query_alice ]).documents.first['name']).to eq('alice')
332332
end
333333
end

0 commit comments

Comments
 (0)