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
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:
@@ -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")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user