Skip to content

Commit 58daa2f

Browse files
committed
fix: DNS tests timeout due to network instability
1 parent 8382b29 commit 58daa2f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

app/dns/nameserver_local_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313

1414
func TestLocalNameServer(t *testing.T) {
1515
s := NewLocalNameServer()
16-
ctx, cancel := context.WithTimeout(context.Background(), time.Second*2)
16+
ctx, cancel := context.WithTimeout(context.Background(), time.Second*5)
1717
ips, err := s.QueryIP(ctx, "google.com", net.IP{}, dns.IPOption{
1818
IPv4Enable: true,
1919
IPv6Enable: true,

app/dns/nameserver_quic_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ func TestQUICNameServer(t *testing.T) {
1919
common.Must(err)
2020
s, err := NewQUICNameServer(url)
2121
common.Must(err)
22-
ctx, cancel := context.WithTimeout(context.Background(), time.Second*2)
22+
ctx, cancel := context.WithTimeout(context.Background(), time.Second*5)
2323
ips, err := s.QueryIP(ctx, "google.com", net.IP(nil), dns_feature.IPOption{
2424
IPv4Enable: true,
2525
IPv6Enable: true,
@@ -36,7 +36,7 @@ func TestQUICNameServerWithCache(t *testing.T) {
3636
common.Must(err)
3737
s, err := NewQUICNameServer(url)
3838
common.Must(err)
39-
ctx, cancel := context.WithTimeout(context.Background(), time.Second*2)
39+
ctx, cancel := context.WithTimeout(context.Background(), time.Second*5)
4040
ips, err := s.QueryIP(ctx, "google.com", net.IP(nil), dns_feature.IPOption{
4141
IPv4Enable: true,
4242
IPv6Enable: true,
@@ -47,7 +47,7 @@ func TestQUICNameServerWithCache(t *testing.T) {
4747
t.Error("expect some ips, but got 0")
4848
}
4949

50-
ctx2, cancel := context.WithTimeout(context.Background(), time.Second*2)
50+
ctx2, cancel := context.WithTimeout(context.Background(), time.Second*5)
5151
ips2, err := s.QueryIP(ctx2, "google.com", net.IP(nil), dns_feature.IPOption{
5252
IPv4Enable: true,
5353
IPv6Enable: true,

0 commit comments

Comments
 (0)