Skip to content

Commit

Permalink
Revert "add backoff"
Browse files Browse the repository at this point in the history
This reverts commit 4a5ab5b.
  • Loading branch information
eshitachandwani committed Nov 29, 2024
1 parent fd061c7 commit c6dbcbc
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions internal/resolver/delegatingresolver/delegatingresolver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ func (s) TestDelegatingResolverNoProxy(t *testing.T) {
if err != nil || dr == nil {
t.Fatalf("Failed to create delegating resolver: %v", err)
}
t.Cleanup(func() { dr.Close() })

// Update the manual resolver with a test address.
mr.UpdateState(resolver.State{
Expand Down Expand Up @@ -163,7 +162,6 @@ func (s) TestDelegatingResolverwithDNSAndProxyWithTargetResolution(t *testing.T)

tcc, stateCh, _ := createTestResolverClientConn(t)
dr, err := New(resolver.Target{URL: *testutils.MustParseURL(target)}, tcc, resolver.BuildOptions{}, mrTarget, true)
t.Cleanup(func() { dr.Close() })
if err != nil {
t.Fatalf("Failed to create delegating resolver: %v", err)
}
Expand Down Expand Up @@ -220,7 +218,6 @@ func (s) TestDelegatingResolverwithDNSAndProxyWithNoTargetResolution(t *testing.
if dr == nil {
t.Fatalf("Failed to create delegating resolver")
}
t.Cleanup(func() { dr.Close() })

mrProxy.UpdateState(resolver.State{
Addresses: []resolver.Address{{Addr: resolvedProxyTestAddr}},
Expand All @@ -241,7 +238,7 @@ func (s) TestDelegatingResolverwithDNSAndProxyWithNoTargetResolution(t *testing.
// correctly updates state with resolved proxy address and custom resolved target
// address as the attributes when the target URI scheme is not DNS and a proxy is
// configured.
func (s)TestDelegatingResolverwithCustomResolverAndProxy(t *testing.T) {
func (s) TestDelegatingResolverwithCustomResolverAndProxy(t *testing.T) {
hpfe := func(req *http.Request) (*url.URL, error) {
if req.URL.Host == targetTestAddr {
return &url.URL{
Expand All @@ -252,13 +249,13 @@ func (s)TestDelegatingResolverwithCustomResolverAndProxy(t *testing.T) {
return nil, nil
}
defer overwrite(hpfe)()

mrTarget := manual.NewBuilderWithScheme("test") // Manual resolver to control the target resolution.
mrProxy := setupDNS(t) // Set up a manual DNS resolver to control the proxy address resolution.
target := "test:///" + targetTestAddr

tcc, stateCh, _ := createTestResolverClientConn(t)
dr, err := New(resolver.Target{URL: *testutils.MustParseURL(target)}, tcc, resolver.BuildOptions{}, mrTarget, false)
// t.Cleanup(func() { dr.Close() })
if err != nil {
t.Fatalf("Failed to create delegating resolver: %v", err)
}
Expand Down Expand Up @@ -301,9 +298,8 @@ func (s)TestDelegatingResolverwithCustomResolverAndProxy(t *testing.T) {
},
ServiceConfig: &serviceconfig.ParseResult{},
}
dr.Close()

if state := <-stateCh; len(state.Addresses) != 4 || !cmp.Equal(expectedState, state) {
t.Fatalf("Unexpected state from delegating resolver: %v\n, want %v\n", state, expectedState)
}

}

0 comments on commit c6dbcbc

Please sign in to comment.