Expand P2 test coverage: mining chain, spread lanes, path forge, WS/beacon, E2E onion, file handling
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
This commit is contained in:
27
agent/client/fleet_role_lifecycle_test.go
Normal file
27
agent/client/fleet_role_lifecycle_test.go
Normal file
@@ -0,0 +1,27 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
"context"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"crypto-miner-agent/config"
|
||||
)
|
||||
|
||||
func TestMiningChainSkipsWhenSeederRole(t *testing.T) {
|
||||
setupNoContainerRuntime(t)
|
||||
cfg := baseMiningCfg()
|
||||
cfg.SeederMode = true
|
||||
cfg.FleetRole = config.FleetRoleSeeder
|
||||
c := miningChainTestClient(t, cfg)
|
||||
c.connected.Store(true)
|
||||
c.miningChain = newTestMiningChainRunner(t, c)
|
||||
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 200*time.Millisecond)
|
||||
defer cancel()
|
||||
c.startMiningWhenReady(ctx)
|
||||
|
||||
if r := c.miningChain.Status(); r.ActiveMethod != "" {
|
||||
t.Fatalf("seeder should not start chain, active=%q", r.ActiveMethod)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user