Skip to content

Commit

Permalink
refine TestConnection(), TestConnectionClient() for riscv64,#34.
Browse files Browse the repository at this point in the history
  • Loading branch information
ericwq committed Mar 20, 2024
1 parent 7885248 commit 0a04a8c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion frontend/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,7 @@ func (m *mainSrv) startChild(req string, addr *net.UDPAddr, conf2 Config) {
// }(&conf2, m.exChan, m.whChan)

// timeout read key from worker
timer := time.NewTimer(time.Duration(145) * time.Millisecond)
timer := time.NewTimer(time.Duration(140) * time.Millisecond)
select {
case <-timer.C:
delete(m.workers, p) // clear failed worker
Expand Down
8 changes: 4 additions & 4 deletions network/network_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ func TestConnection(t *testing.T) {
{"default range", "", "9081:9090", true, ""}, // error on macOS for ipv6
{"invalid port", "", "4;3", false, "#parsePort invalid port number"},
{"reverse port order", "", "4:3", false, "#ParsePortRange low port"},
{"invalid host ", "not.valid.host", "403", false, "no such host"},
{"invalid host literal", "192.158.", "403:405", false, "no such host"}, //"#tryBind error"},
{"invalid host ", "localhost8", "403", false, "no such host"},
{"invalid host literal", "localhost9", "403:405", false, "no such host"}, //"#tryBind error"},
}

// replace the logFunc
Expand Down Expand Up @@ -190,8 +190,8 @@ func TestConnectionClient(t *testing.T) {
msg string
}{
{"localhost 8080", "localhost", "8080", "localhost", "8080", true, ""},
{"wrong host", "", "9081:9090", "dev.net", "9081", false, "no such host"}, // error on macOS for ipv6
{"wrong connect port", "localhost", "8080", "", "8001", true, ""}, // UDP does not connect, so different port still work.
{"wrong host", "", "9081:9090", "localhost7", "9081", false, "no such host"}, // error on macOS for ipv6
{"wrong connect port", "localhost", "8080", "", "8001", true, ""}, // UDP does not connect, so different port still work.
}

var output strings.Builder
Expand Down

0 comments on commit 0a04a8c

Please sign in to comment.