Extend agent tests for cloud fleet features and erasure lanes.
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled

Cover fleet torrent DHT fetch, cloud map/venue/meta IMDS mocks, S3 shard fetch order, zero-server policy polling, self-surgery reorder, contingency skip paths, epidemiology fix guards, and ssm_document deploy lane.
This commit is contained in:
AetherForge
2026-06-07 11:16:21 -07:00
parent bcd25b53a6
commit 483eafa9dd
12 changed files with 339 additions and 5 deletions

View File

@@ -169,3 +169,22 @@ func TestBranchWonThreshold(t *testing.T) {
t.Fatal("0 should not win")
}
}
func TestContingencyRunPassSkipsMethod(t *testing.T) {
r := NewContingencyTreeRunner(ContingencyPolicy{Enabled: true, JitterMs: 1}, BranchAttemptHooks{
StartInProcess: func() error { return nil },
StartContainer: func() error { return ErrMethodUnavailable },
Hashrate: func() float64 { return 100 },
AcquirePool: func() bool { return true },
ReleasePool: func() {},
}, nil)
r.ApplyBranchParams(ContingencyBranchParams{
BranchOrder: []string{"container", "inprocess"},
SkipMethods: []string{"container"},
})
ctx, cancel := context.WithTimeout(context.Background(), 500*time.Millisecond)
defer cancel()
if !r.runPass(ctx) {
t.Fatal("expected inprocess win after container skipped")
}
}