Make tests more stable

This commit is contained in:
Jonathan Leibiusky @xetorthio
2017-07-18 15:29:00 -03:00
parent 4eda861329
commit 56e2899dcf

View File

@@ -15,6 +15,7 @@ import (
"net/http/httptest"
"net/url"
"os"
"sort"
"strings"
"sync"
"testing"
@@ -434,6 +435,9 @@ func TestProxy_DNS_UDP(t *testing.T) {
expectedIps, err := net.LookupHost("www.google.com")
assert.Nil(t, err)
sort.Strings(expectedIps)
sort.Strings(ips)
assert.Equal(t, expectedIps, ips)
ips, err = routerLookup("udp", "localhost", r)
@@ -471,6 +475,9 @@ func TestProxy_DNS_TCP(t *testing.T) {
expectedIps, err := net.LookupHost("www.google.com")
assert.Nil(t, err)
sort.Strings(expectedIps)
sort.Strings(ips)
assert.Equal(t, expectedIps, ips)
ips, err = routerLookup("tcp", "localhost", r)