88 "testing"
99 "time"
1010
11- "github.com/AdguardTeam/dnsproxy/internal/dnsproxytest"
1211 "github.com/AdguardTeam/dnsproxy/upstream"
1312 "github.com/AdguardTeam/golibs/netutil"
1413 "github.com/AdguardTeam/golibs/testutil"
@@ -24,7 +23,7 @@ import (
2423func newUpstreamWithErrorRate (rate uint , name string ) (u upstream.Upstream ) {
2524 var n uint
2625
27- return & dnsproxytest. Upstream {
26+ return & testUpstream {
2827 OnExchange : func (req * dns.Msg ) (resp * dns.Msg , err error ) {
2928 n ++
3029 if n % rate == 0 {
@@ -87,7 +86,7 @@ func TestProxy_Exchange_loadBalance(t *testing.T) {
8786 },
8887 }
8988
90- fastUps := & dnsproxytest. Upstream {
89+ fastUps := & testUpstream {
9190 OnExchange : func (req * dns.Msg ) (resp * dns.Msg , err error ) {
9291 currentNow = zeroTime .Add (testRTT / 100 )
9392
@@ -96,7 +95,7 @@ func TestProxy_Exchange_loadBalance(t *testing.T) {
9695 OnAddress : func () (addr string ) { return "fast" },
9796 OnClose : func () (_ error ) { panic (testutil .UnexpectedCall ()) },
9897 }
99- slowerUps := & dnsproxytest. Upstream {
98+ slowerUps := & testUpstream {
10099 OnExchange : func (req * dns.Msg ) (resp * dns.Msg , err error ) {
101100 currentNow = zeroTime .Add (testRTT / 10 )
102101
@@ -105,7 +104,7 @@ func TestProxy_Exchange_loadBalance(t *testing.T) {
105104 OnAddress : func () (addr string ) { return "slower" },
106105 OnClose : func () (_ error ) { panic (testutil .UnexpectedCall ()) },
107106 }
108- slowestUps := & dnsproxytest. Upstream {
107+ slowestUps := & testUpstream {
109108 OnExchange : func (req * dns.Msg ) (resp * dns.Msg , err error ) {
110109 currentNow = zeroTime .Add (testRTT / 2 )
111110
@@ -115,20 +114,20 @@ func TestProxy_Exchange_loadBalance(t *testing.T) {
115114 OnClose : func () (_ error ) { panic (testutil .UnexpectedCall ()) },
116115 }
117116
118- err1Ups := & dnsproxytest. Upstream {
117+ err1Ups := & testUpstream {
119118 OnExchange : func (_ * dns.Msg ) (r * dns.Msg , err error ) { return nil , assert .AnError },
120119 OnAddress : func () (addr string ) { return "error1" },
121120 OnClose : func () (_ error ) { panic (testutil .UnexpectedCall ()) },
122121 }
123- err2Ups := & dnsproxytest. Upstream {
122+ err2Ups := & testUpstream {
124123 OnExchange : func (_ * dns.Msg ) (r * dns.Msg , err error ) { return nil , assert .AnError },
125124 OnAddress : func () (addr string ) { return "error2" },
126125 OnClose : func () (_ error ) { panic (testutil .UnexpectedCall ()) },
127126 }
128127
129128 singleError := & sync.Once {}
130129 // fastestUps responds with an error on the first request.
131- fastestUps := & dnsproxytest. Upstream {
130+ fastestUps := & testUpstream {
132131 OnExchange : func (req * dns.Msg ) (resp * dns.Msg , err error ) {
133132 singleError .Do (func () { err = assert .AnError })
134133 currentNow = zeroTime .Add (testRTT / 200 )
0 commit comments