@@ -60,14 +60,11 @@ func (s) TestADS_ACK_NACK_Simple(t *testing.T) {
60
60
streamResponseCh := testutils .NewChannel ()
61
61
mgmtServer := e2e .StartManagementServer (t , e2e.ManagementServerOptions {
62
62
OnStreamRequest : func (_ int64 , req * v3discoverypb.DiscoveryRequest ) error {
63
- streamRequestCh .Send ( req )
63
+ streamRequestCh .SendContext ( ctx , req )
64
64
return nil
65
65
},
66
66
OnStreamResponse : func (_ context.Context , _ int64 , _ * v3discoverypb.DiscoveryRequest , resp * v3discoverypb.DiscoveryResponse ) {
67
- // The go-control-plane management server continuously resends the
68
- // same resource if NACKed by the client. Hence, we need to use
69
- // `Replace` here instead of `Send`.
70
- streamResponseCh .Replace (resp )
67
+ streamResponseCh .SendContext (ctx , resp )
71
68
},
72
69
})
73
70
@@ -242,11 +239,11 @@ func (s) TestADS_ACK_NACK_InvalidFirstResponse(t *testing.T) {
242
239
streamResponseCh := testutils .NewChannel ()
243
240
mgmtServer := e2e .StartManagementServer (t , e2e.ManagementServerOptions {
244
241
OnStreamRequest : func (_ int64 , req * v3discoverypb.DiscoveryRequest ) error {
245
- streamRequestCh .Send ( req )
242
+ streamRequestCh .SendContext ( ctx , req )
246
243
return nil
247
244
},
248
245
OnStreamResponse : func (_ context.Context , _ int64 , _ * v3discoverypb.DiscoveryRequest , resp * v3discoverypb.DiscoveryResponse ) {
249
- streamResponseCh .Send ( resp )
246
+ streamResponseCh .SendContext ( ctx , resp )
250
247
},
251
248
})
252
249
@@ -347,11 +344,11 @@ func (s) TestADS_ACK_NACK_ResourceIsNotRequestedAnymore(t *testing.T) {
347
344
streamResponseCh := testutils .NewChannel ()
348
345
mgmtServer := e2e .StartManagementServer (t , e2e.ManagementServerOptions {
349
346
OnStreamRequest : func (_ int64 , req * v3discoverypb.DiscoveryRequest ) error {
350
- streamRequestCh .Send ( req )
347
+ streamRequestCh .SendContext ( ctx , req )
351
348
return nil
352
349
},
353
350
OnStreamResponse : func (_ context.Context , _ int64 , _ * v3discoverypb.DiscoveryRequest , resp * v3discoverypb.DiscoveryResponse ) {
354
- streamResponseCh .Send ( resp )
351
+ streamResponseCh .SendContext ( ctx , resp )
355
352
},
356
353
})
357
354
0 commit comments