@@ -25,9 +25,9 @@ func (s *ConnectionSuite) TestConnection_Query_Ok(c *test.C) {
2525 header := respHeader (token , respData )
2626
2727 conn := & connMock {}
28- conn .On ("Write" , writeData ).Return (len (writeData ), nil )
29- conn .On ("Read" , respHeaderLen ).Return (header , respHeaderLen , nil )
30- conn .On ("Read" , len (respData )).Return (respData , len (respData ), nil )
28+ conn .On ("Write" , writeData ).Return (len (writeData ), nil , nil )
29+ conn .On ("Read" , respHeaderLen ).Return (header , respHeaderLen , nil , nil )
30+ conn .On ("Read" , len (respData )).Return (respData , len (respData ), nil , nil )
3131 conn .On ("Close" ).Return (nil )
3232
3333 connection := newConnection (conn , "addr" , & ConnectOpts {})
@@ -60,9 +60,9 @@ func (s *ConnectionSuite) TestConnection_Query_DefaultDBOk(c *test.C) {
6060 header := respHeader (token , respData )
6161
6262 conn := & connMock {}
63- conn .On ("Write" , writeData ).Return (len (writeData ), nil )
64- conn .On ("Read" , respHeaderLen ).Return (header , respHeaderLen , nil )
65- conn .On ("Read" , len (respData )).Return (respData , len (respData ), nil )
63+ conn .On ("Write" , writeData ).Return (len (writeData ), nil , nil )
64+ conn .On ("Read" , respHeaderLen ).Return (header , respHeaderLen , nil , nil )
65+ conn .On ("Read" , len (respData )).Return (respData , len (respData ), nil , nil )
6666 conn .On ("Close" ).Return (nil )
6767
6868 connection := newConnection (conn , "addr" , & ConnectOpts {Database : "db" })
@@ -106,7 +106,7 @@ func (s *ConnectionSuite) TestConnection_Query_SendFail(c *test.C) {
106106 writeData := serializeQuery (token , q )
107107
108108 conn := & connMock {}
109- conn .On ("Write" , writeData ).Return (0 , io .EOF )
109+ conn .On ("Write" , writeData ).Return (0 , io .EOF , nil )
110110
111111 connection := newConnection (conn , "addr" , & ConnectOpts {})
112112 response , cursor , err := connection .Query (ctx , q )
@@ -126,9 +126,9 @@ func (s *ConnectionSuite) TestConnection_Query_NoReplyOk(c *test.C) {
126126 header := respHeader (token , respData )
127127
128128 conn := & connMock {}
129- conn .On ("Write" , writeData ).Return (len (writeData ), nil )
130- conn .On ("Read" , respHeaderLen ).Return (header , respHeaderLen , nil )
131- conn .On ("Read" , len (respData )).Return (respData , len (respData ), nil )
129+ conn .On ("Write" , writeData ).Return (len (writeData ), nil , nil )
130+ conn .On ("Read" , respHeaderLen ).Return (header , respHeaderLen , nil , nil )
131+ conn .On ("Read" , len (respData )).Return (respData , len (respData ), nil , nil )
132132 conn .On ("Close" ).Return (nil )
133133
134134 connection := newConnection (conn , "addr" , & ConnectOpts {})
@@ -151,9 +151,8 @@ func (s *ConnectionSuite) TestConnection_Query_TimeoutWrite(c *test.C) {
151151 stopData := serializeQuery (token , newStopQuery (token ))
152152
153153 conn := & connMock {}
154- conn .On ("Write" , writeData ).Return (len (writeData ), nil )
155- conn .On ("Write" , stopData ).Return (len (stopData ), nil )
156- conn .On ("SetWriteDeadline" ).Return (nil )
154+ conn .On ("Write" , writeData ).Return (len (writeData ), nil , nil )
155+ conn .On ("Write" , stopData ).Return (len (stopData ), nil , nil )
157156
158157 connection := newConnection (conn , "addr" , & ConnectOpts {ReadTimeout : time .Millisecond , WriteTimeout : time .Millisecond })
159158 connection .readRequestsChan = make (chan tokenAndPromise , 0 )
@@ -174,9 +173,8 @@ func (s *ConnectionSuite) TestConnection_Query_TimeoutRead(c *test.C) {
174173 stopData := serializeQuery (token , newStopQuery (token ))
175174
176175 conn := & connMock {}
177- conn .On ("Write" , writeData ).Return (len (writeData ), nil )
178- conn .On ("Write" , stopData ).Return (len (stopData ), nil )
179- conn .On ("SetWriteDeadline" ).Return (nil )
176+ conn .On ("Write" , writeData ).Return (len (writeData ), nil , 10 * time .Millisecond )
177+ conn .On ("Write" , stopData ).Return (len (stopData ), nil , nil )
180178
181179 connection := newConnection (conn , "addr" , & ConnectOpts {ReadTimeout : time .Millisecond , WriteTimeout : time .Millisecond })
182180 response , cursor , err := connection .Query (ctx , q )
@@ -196,7 +194,7 @@ func (s *ConnectionSuite) TestConnection_Query_SendFailTracing(c *test.C) {
196194 writeData := serializeQuery (token , q )
197195
198196 conn := & connMock {}
199- conn .On ("Write" , writeData ).Return (0 , io .EOF )
197+ conn .On ("Write" , writeData ).Return (0 , io .EOF , nil )
200198
201199 connection := newConnection (conn , "addr" , & ConnectOpts {UseOpentracing : true })
202200 response , cursor , err := connection .Query (ctx , q )
@@ -306,8 +304,7 @@ func (s *ConnectionSuite) TestConnection_readResponse_TimeoutHeader(c *test.C) {
306304 timeout := time .Second
307305
308306 conn := & connMock {}
309- conn .On ("SetReadDeadline" ).Return (nil )
310- conn .On ("Read" , respHeaderLen ).Return (nil , 0 , io .EOF )
307+ conn .On ("Read" , respHeaderLen ).Return (nil , 0 , io .EOF , nil )
311308
312309 connection := newConnection (conn , "addr" , & ConnectOpts {ReadTimeout : timeout })
313310
@@ -325,8 +322,8 @@ func (s *ConnectionSuite) TestConnection_readResponse_BodySocketErr(c *test.C) {
325322 header := respHeader (token , respData )
326323
327324 conn := & connMock {}
328- conn .On ("Read" , respHeaderLen ).Return (header , len (header ), nil )
329- conn .On ("Read" , len (respData )).Return (nil , 0 , io .EOF )
325+ conn .On ("Read" , respHeaderLen ).Return (header , len (header ), nil , nil )
326+ conn .On ("Read" , len (respData )).Return (nil , 0 , io .EOF , nil )
330327
331328 connection := newConnection (conn , "addr" , & ConnectOpts {})
332329
@@ -344,8 +341,8 @@ func (s *ConnectionSuite) TestConnection_readResponse_BodyUnmarshalErr(c *test.C
344341 header := respHeader (token , respData )
345342
346343 conn := & connMock {}
347- conn .On ("Read" , respHeaderLen ).Return (header , len (header ), nil )
348- conn .On ("Read" , len (respData )).Return (make ([]byte , len (respData )), len (respData ), nil )
344+ conn .On ("Read" , respHeaderLen ).Return (header , len (header ), nil , nil )
345+ conn .On ("Read" , len (respData )).Return (make ([]byte , len (respData )), len (respData ), nil , nil )
349346
350347 connection := newConnection (conn , "addr" , & ConnectOpts {})
351348
0 commit comments