Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled
28 lines
627 B
Go
28 lines
627 B
Go
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)
|
|
}
|
|
}
|