@@ -66,7 +66,7 @@ type clockWithManualSource struct {
6666
6767// transportTester contains objects needed to test the Store Liveness Transport.
6868// Typical usage will add multiple nodes with AddNode, add multiple stores with
69- // AddStore, and send messages with SendAsync .
69+ // AddStore, and send messages with EnqueueMessage .
7070type transportTester struct {
7171 t testing.TB
7272 st * cluster.Settings
@@ -199,7 +199,7 @@ func TestTransportSendAndReceive(t *testing.T) {
199199 // Send messages between each pair of stores.
200200 for _ , from := range stores {
201201 for _ , to := range stores {
202- tt .transports [from .NodeID ].SendAsync (ctx , makeMsg (from , to ))
202+ tt .transports [from .NodeID ].EnqueueMessage (ctx , makeMsg (from , to ))
203203 }
204204 }
205205
@@ -261,7 +261,7 @@ func TestTransportRestartedNode(t *testing.T) {
261261 checkEnqueued := func (expectedEnqueued bool ) {
262262 testutils .SucceedsSoon (
263263 t , func () error {
264- enqueued := tt .transports [sender .NodeID ].SendAsync (ctx , msg )
264+ enqueued := tt .transports [sender .NodeID ].EnqueueMessage (ctx , msg )
265265 if enqueued != expectedEnqueued {
266266 return errors .Newf ("enqueue success is still %v" , enqueued )
267267 }
@@ -274,7 +274,7 @@ func TestTransportRestartedNode(t *testing.T) {
274274 initialSent := tt .transports [sender .NodeID ].metrics .MessagesSent .Count ()
275275 testutils .SucceedsSoon (
276276 t , func () error {
277- tt .transports [sender .NodeID ].SendAsync (ctx , msg )
277+ tt .transports [sender .NodeID ].EnqueueMessage (ctx , msg )
278278 sent := tt .transports [sender .NodeID ].metrics .MessagesSent .Count ()
279279 if initialSent >= sent {
280280 return errors .Newf ("message not sent yet; initial %d, current %d" , initialSent , sent )
@@ -288,7 +288,7 @@ func TestTransportRestartedNode(t *testing.T) {
288288 initialDropped := tt .transports [sender .NodeID ].metrics .MessagesSendDropped .Count ()
289289 testutils .SucceedsSoon (
290290 t , func () error {
291- tt .transports [sender .NodeID ].SendAsync (ctx , msg )
291+ tt .transports [sender .NodeID ].EnqueueMessage (ctx , msg )
292292 dropped := tt .transports [sender .NodeID ].metrics .MessagesSendDropped .Count ()
293293 if initialDropped >= dropped {
294294 return errors .Newf (
@@ -309,9 +309,9 @@ func TestTransportRestartedNode(t *testing.T) {
309309 return nil
310310 default :
311311 // To ensure messages start getting delivered, keep sending messages
312- // out. Even after SendAsync returns true, messages may still not be
312+ // out. Even after EnqueueMessage returns true, messages may still not be
313313 // delivered (e.g. if the receiver node is not up yet).
314- tt .transports [sender .NodeID ].SendAsync (ctx , msg )
314+ tt .transports [sender .NodeID ].EnqueueMessage (ctx , msg )
315315 }
316316 return errors .New ("still waiting to receive message" )
317317 },
@@ -322,7 +322,7 @@ func TestTransportRestartedNode(t *testing.T) {
322322 // The message is sent out successfully.
323323 checkEnqueued (true /* expectedEnqueued */ )
324324 // The message sent as part of checkSend above will likely be dropped it's
325- // also possible that the SendAsync races with the deletion of the send queue
325+ // also possible that the EnqueueMessage races with the deletion of the send queue
326326 // (due to the failed node dial), in which case a dropped message will not be
327327 // recorded.
328328 checkDropped ()
@@ -338,7 +338,7 @@ func TestTransportRestartedNode(t *testing.T) {
338338 // fails after the circuit breaker kicks in.
339339 receiverStopper .Stop (context .Background ())
340340 checkEnqueued (false /* expectedEnqueued */ )
341- // Subsequent calls to SendAsync are expected to result in messages being
341+ // Subsequent calls to EnqueueMessage are expected to result in messages being
342342 // dropped due to the tripped circuit breaker.
343343 checkDropped ()
344344
@@ -380,8 +380,8 @@ func TestTransportSendToMissingStore(t *testing.T) {
380380
381381 // Send the message to the missing store first to ensure it doesn't affect the
382382 // receipt of the message to the existing store.
383- require .True (t , tt .transports [sender .NodeID ].SendAsync (ctx , missingMsg ))
384- require .True (t , tt .transports [sender .NodeID ].SendAsync (ctx , existingMsg ))
383+ require .True (t , tt .transports [sender .NodeID ].EnqueueMessage (ctx , missingMsg ))
384+ require .True (t , tt .transports [sender .NodeID ].EnqueueMessage (ctx , existingMsg ))
385385
386386 // Wait for the message to the existing store to be received.
387387 testutils .SucceedsSoon (
@@ -438,7 +438,7 @@ func TestTransportClockPropagation(t *testing.T) {
438438
439439 // Send a message from the sender to the receiver.
440440 msg := slpb.Message {Type : slpb .MsgHeartbeat , From : sender , To : receiver }
441- require .True (t , tt .transports [sender .NodeID ].SendAsync (ctx , msg ))
441+ require .True (t , tt .transports [sender .NodeID ].EnqueueMessage (ctx , msg ))
442442
443443 // Wait for the message to be received.
444444 testutils .SucceedsSoon (
@@ -480,12 +480,12 @@ func TestTransportShortCircuit(t *testing.T) {
480480 handler := tt .AddStore (store2 )
481481 tt .AddStore (store3 )
482482
483- // Reach in and set node 1's dialer to nil. If SendAsync attempts to dial a
483+ // Reach in and set node 1's dialer to nil. If EnqueueMessage attempts to dial a
484484 // node, it will panic.
485485 tt .transports [node1 ].dialer = nil
486486
487487 // Send messages between two stores on the same node.
488- tt .transports [store1 .NodeID ].SendAsync (
488+ tt .transports [store1 .NodeID ].EnqueueMessage (
489489 ctx , slpb.Message {Type : slpb .MsgHeartbeat , From : store1 , To : store2 },
490490 )
491491 // The message is received.
@@ -506,7 +506,7 @@ func TestTransportShortCircuit(t *testing.T) {
506506 // we expect a panic.
507507 require .Panics (
508508 t , func () {
509- tt .transports [store1 .NodeID ].SendAsync (
509+ tt .transports [store1 .NodeID ].EnqueueMessage (
510510 ctx , slpb.Message {Type : slpb .MsgHeartbeat , From : store1 , To : store3 },
511511 )
512512 }, "sending message to a remote store with a nil dialer" ,
@@ -536,7 +536,7 @@ func TestTransportIdleSendQueue(t *testing.T) {
536536 }
537537
538538 // Send and receive a message.
539- require .True (t , tt .transports [sender .NodeID ].SendAsync (ctx , msg ))
539+ require .True (t , tt .transports [sender .NodeID ].EnqueueMessage (ctx , msg ))
540540 testutils .SucceedsSoon (
541541 t , func () error {
542542 select {
@@ -585,7 +585,7 @@ func TestTransportFullReceiveQueue(t *testing.T) {
585585 testutils .SucceedsSoon (
586586 t , func () error {
587587 // The message enqueue can fail temporarily if the sender queue fills up.
588- if ! tt .transports [sender .NodeID ].SendAsync (ctx , msg ) {
588+ if ! tt .transports [sender .NodeID ].EnqueueMessage (ctx , msg ) {
589589 sendDropped ++
590590 return errors .New ("still waiting to enqueue message" )
591591 }
@@ -614,7 +614,7 @@ func TestTransportFullReceiveQueue(t *testing.T) {
614614 },
615615 )
616616 // The receiver queue is full but the enqueue to the sender queue succeeds.
617- require .True (t , tt .transports [sender .NodeID ].SendAsync (ctx , msg ))
617+ require .True (t , tt .transports [sender .NodeID ].EnqueueMessage (ctx , msg ))
618618 testutils .SucceedsSoon (
619619 t , func () error {
620620 if tt .transports [receiver .NodeID ].metrics .MessagesReceiveDropped .Count () != int64 (1 ) {
0 commit comments