@@ -407,47 +407,6 @@ func setupProxyTestWithConfig(ctx context.Context, numNodes int, cfg *proxyTestC
407
407
return tester , proxyAddr , nil
408
408
}
409
409
410
- func TestProxy_Consistency (t * testing.T ) {
411
- ctx , cancel := context .WithCancel (context .Background ())
412
- tester , proxyContactPoint , err := setupProxyTest (ctx , 3 , proxycore.MockRequestHandlers {
413
- primitive .OpCodeQuery : func (cl * proxycore.MockClient , frm * frame.Frame ) message.Message {
414
- qry := frm .Body .Message .(* message.Query )
415
- if qry .Query == "SELECT * FROM test.test" {
416
- // A read timeout is not retried because of 0 replicas received
417
- return & message.ReadTimeout {
418
- ErrorMessage : "this is a mock read timeout error" ,
419
- Consistency : getConsistencyLevel (frm .Body .Message ),
420
- Received : 0 ,
421
- BlockFor : 1 ,
422
- DataPresent : false ,
423
- }
424
- }
425
- return cl .InterceptQuery (frm .Header , frm .Body .Message .(* message.Query ))
426
- },
427
- })
428
- defer func () {
429
- cancel ()
430
- tester .shutdown ()
431
- }()
432
- require .NoError (t , err )
433
-
434
- cl , err := proxycore .ConnectClient (ctx , proxycore .NewEndpoint (proxyContactPoint ), proxycore.ClientConnConfig {})
435
- require .NoError (t , err )
436
-
437
- version , err := cl .Handshake (ctx , primitive .ProtocolVersion5 , nil )
438
- require .NoError (t , err )
439
- assert .Equal (t , primitive .ProtocolVersion4 , version ) // Expected to be negotiated to v4
440
-
441
- _ , err = cl .Query (ctx , primitive .ProtocolVersion4 , & message.Query {
442
- Query : "SELECT * FROM test.test" ,
443
- Options : & message.QueryOptions {
444
- Consistency : primitive .ConsistencyLevelOne ,
445
- },
446
- })
447
-
448
- print (err )
449
- }
450
-
451
410
func connectTestClient (t * testing.T , ctx context.Context , proxyContactPoint string ) * proxycore.ClientConn {
452
411
cl , err := proxycore .ConnectClient (ctx , proxycore .NewEndpoint (proxyContactPoint ), proxycore.ClientConnConfig {})
453
412
require .NoError (t , err )
@@ -459,19 +418,6 @@ func connectTestClient(t *testing.T, ctx context.Context, proxyContactPoint stri
459
418
return cl
460
419
}
461
420
462
- func getConsistencyLevel (message message.Message ) primitive.ConsistencyLevel {
463
- switch m := message .(type ) {
464
- case * partialQuery :
465
- return m .Consistency
466
- case * partialBatch :
467
- return m .Consistency
468
- case * partialExecute :
469
- return m .Consistency
470
- default :
471
- return primitive .ConsistencyLevelOne
472
- }
473
- }
474
-
475
421
func waitUntil (d time.Duration , check func () bool ) bool {
476
422
iterations := int (d / (100 * time .Millisecond ))
477
423
for i := 0 ; i < iterations ; i ++ {
0 commit comments