File tree 1 file changed +10
-3
lines changed
xds/internal/balancer/priority
1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -493,7 +493,11 @@ func (s) TestPriority_HigherDownWhileAddingLower(t *testing.T) {
493
493
sc0 := <- cc .NewSubConnCh
494
494
495
495
t .Log ("Turn down 0, 1 is used." )
496
- sc0 .UpdateState (balancer.SubConnState {ConnectivityState : connectivity .TransientFailure })
496
+ testErr := errors .New ("test error" )
497
+ sc0 .UpdateState (balancer.SubConnState {
498
+ ConnectivityState : connectivity .TransientFailure ,
499
+ ConnectionError : testErr ,
500
+ })
497
501
498
502
// Before 1 gets READY, picker should return NoSubConnAvailable, so RPCs
499
503
// will retry.
@@ -508,10 +512,13 @@ func (s) TestPriority_HigherDownWhileAddingLower(t *testing.T) {
508
512
sc1 := <- cc .NewSubConnCh
509
513
510
514
t .Log ("Turn down 1, pick should error." )
511
- sc1 .UpdateState (balancer.SubConnState {ConnectivityState : connectivity .TransientFailure })
515
+ sc1 .UpdateState (balancer.SubConnState {
516
+ ConnectivityState : connectivity .TransientFailure ,
517
+ ConnectionError : testErr ,
518
+ })
512
519
513
520
// Test pick failure.
514
- if err := cc .WaitForErrPicker (ctx ); err != nil {
521
+ if err := cc .WaitForPickerWithErr (ctx , testErr ); err != nil {
515
522
t .Fatal (err .Error ())
516
523
}
517
524
<- cc .NewStateCh // Drain to match picker
You can’t perform that action at this time.
0 commit comments