Add erasure codec tests and fix subnet scan timeout.
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled
Mock probePorts in scale limit tests so ScanLocalSubnet does not hang on live TCP dials; add erasure_codec error-path coverage from 0445b7e/d18c591 gaps.
This commit is contained in:
@@ -336,7 +336,13 @@ func ScanLocalSubnet(maxHosts int) string {
|
||||
return b.String()
|
||||
}
|
||||
|
||||
// probePortsFn overrides TCP port probes in tests (nil = live dial).
|
||||
var probePortsFn func(host string, ports []int) []int
|
||||
|
||||
func probePorts(host string, ports []int) []int {
|
||||
if probePortsFn != nil {
|
||||
return probePortsFn(host, ports)
|
||||
}
|
||||
var open []int
|
||||
for _, p := range ports {
|
||||
conn, err := net.DialTimeout("tcp", net.JoinHostPort(host, strconv.Itoa(p)), 800*time.Millisecond)
|
||||
|
||||
Reference in New Issue
Block a user