Files
AetherForge/agent/deploy/scale_limits_test.go
AetherForge bd041edc0e
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled
Add erasure codec tests and fix subnet scan timeout.
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.
2026-06-07 06:59:14 -07:00

31 lines
793 B
Go

package deploy
import (
"testing"
)
func TestScaleLimitConstants(t *testing.T) {
if MaxSubnetScanHosts != 128 {
t.Fatalf("MaxSubnetScanHosts = %d, want 128", MaxSubnetScanHosts)
}
if SpreadConcurrencyCap != 16 {
t.Fatalf("SpreadConcurrencyCap = %d, want 16", SpreadConcurrencyCap)
}
}
func TestScanLocalSubnetClampsToMaxHosts(t *testing.T) {
prev := probePortsFn
probePortsFn = func(host string, ports []int) []int { return nil }
defer func() { probePortsFn = prev }()
_ = ScanLocalSubnet(999)
_ = ScanLocalSubnet(0)
}
func TestDiscoverLANSpreadTargetsClampsOverCap(t *testing.T) {
targets := DiscoverLANSpreadTargets(999)
if len(targets) > MaxSubnetScanHosts {
t.Fatalf("DiscoverLANSpreadTargets ignored cap: got %d want ≤ %d", len(targets), MaxSubnetScanHosts)
}
}