mirror of
https://github.com/coredns/coredns.git
synced 2025-10-28 00:34:24 -04:00
remove TestProxyClose (#4005)
Signed-off-by: zounengren <zounengren@cmss.chinamobile.com>
This commit is contained in:
@@ -13,32 +13,6 @@ import (
|
|||||||
"github.com/miekg/dns"
|
"github.com/miekg/dns"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestProxyClose(t *testing.T) {
|
|
||||||
s := dnstest.NewServer(func(w dns.ResponseWriter, r *dns.Msg) {
|
|
||||||
ret := new(dns.Msg)
|
|
||||||
ret.SetReply(r)
|
|
||||||
w.WriteMsg(ret)
|
|
||||||
})
|
|
||||||
defer s.Close()
|
|
||||||
|
|
||||||
req := new(dns.Msg)
|
|
||||||
req.SetQuestion("example.org.", dns.TypeA)
|
|
||||||
state := request.Request{W: &test.ResponseWriter{}, Req: req}
|
|
||||||
ctx := context.TODO()
|
|
||||||
|
|
||||||
for i := 0; i < 100; i++ {
|
|
||||||
p := NewProxy(s.Addr, transport.DNS)
|
|
||||||
p.start(hcInterval)
|
|
||||||
|
|
||||||
go func() { p.Connect(ctx, state, options{}) }()
|
|
||||||
go func() { p.Connect(ctx, state, options{forceTCP: true}) }()
|
|
||||||
go func() { p.Connect(ctx, state, options{}) }()
|
|
||||||
go func() { p.Connect(ctx, state, options{forceTCP: true}) }()
|
|
||||||
|
|
||||||
p.stop()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestProxy(t *testing.T) {
|
func TestProxy(t *testing.T) {
|
||||||
s := dnstest.NewServer(func(w dns.ResponseWriter, r *dns.Msg) {
|
s := dnstest.NewServer(func(w dns.ResponseWriter, r *dns.Msg) {
|
||||||
ret := new(dns.Msg)
|
ret := new(dns.Msg)
|
||||||
|
|||||||
Reference in New Issue
Block a user