Add erasure codec tests and fix subnet scan timeout.
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:
AetherForge
2026-06-07 06:59:14 -07:00
parent f5e9b765fe
commit bd041edc0e
5 changed files with 87 additions and 2 deletions

View File

@@ -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)