@@ -636,8 +636,8 @@ func (s) TestDNSResolver_ExponentialBackoff(t *testing.T) {
636636func (s ) TestDNSResolver_ResolveNow (t * testing.T ) {
637637 const target = "foo.bar.com"
638638
639- overrideResolutionInterval (t , 0 )
640- overrideTimeAfterFunc (t , 0 )
639+ overrideResolutionInterval (t , 10 )
640+ // overrideTimeAfterFunc(t, 0)
641641 tr := & testNetResolver {
642642 hostLookupTable : map [string ][]string {
643643 "foo.bar.com" : {"1.2.3.4" , "5.6.7.8" },
@@ -653,7 +653,7 @@ func (s) TestDNSResolver_ResolveNow(t *testing.T) {
653653 // Verify that the first update pushed by the resolver matches expectations.
654654 wantAddrs := []resolver.Address {{Addr : "1.2.3.4" + colonDefaultPort }, {Addr : "5.6.7.8" + colonDefaultPort }}
655655 wantSC := scJSON
656- ctx , cancel := context .WithTimeout (context .Background (), defaultTestTimeout )
656+ ctx , cancel := context .WithTimeout (context .Background (), 3 * defaultTestTimeout )
657657 defer cancel ()
658658 verifyUpdateFromResolver (ctx , t , stateCh , wantAddrs , nil , wantSC )
659659
@@ -666,19 +666,24 @@ func (s) TestDNSResolver_ResolveNow(t *testing.T) {
666666
667667 // Ask the resolver to re-resolve and verify that the new update matches
668668 // expectations.
669+ fmt .Printf ("1st resolve sent %v\n " , time .Now ())
670+ time .Sleep (10 * time .Second )
669671 r .ResolveNow (resolver.ResolveNowOptions {})
670672 wantAddrs = []resolver.Address {{Addr : "1.2.3.4" + colonDefaultPort }}
671673 wantSC = `{"loadBalancingPolicy": "grpclb"}`
672674 verifyUpdateFromResolver (ctx , t , stateCh , wantAddrs , nil , wantSC )
675+ fmt .Printf ("1st resolve completed %v\n " , time .Now ())
673676
674677 // Update state in the fake resolver to return no addresses and the same
675678 // service config as before.
676679 tr .UpdateHostLookupTable (map [string ][]string {target : nil })
677680
678681 // Ask the resolver to re-resolve and verify that the new update matches
679682 // expectations.
683+ fmt .Printf ("2nd resolve sent %v\n " , time .Now ())
680684 r .ResolveNow (resolver.ResolveNowOptions {})
681685 verifyUpdateFromResolver (ctx , t , stateCh , nil , nil , wantSC )
686+ fmt .Printf ("2nd resolve completed %v\n " , time .Now ())
682687}
683688
684689// Tests the case where the given name is an IP address and verifies that the
0 commit comments