MCPcopy
hub / github.com/etcd-io/etcd / StartEtcdProcessCluster

Function StartEtcdProcessCluster

tests/framework/e2e/cluster.go:484–507  ·  view source on GitHub ↗

StartEtcdProcessCluster launches a new cluster from etcd processes.

(ctx context.Context, t testing.TB, epc *EtcdProcessCluster, cfg *EtcdProcessClusterConfig)

Source from the content-addressed store, hash-verified

482
483// StartEtcdProcessCluster launches a new cluster from etcd processes.
484func StartEtcdProcessCluster(ctx context.Context, t testing.TB, epc *EtcdProcessCluster, cfg *EtcdProcessClusterConfig) (*EtcdProcessCluster, error) {
485 if cfg.RollingStart {
486 if err := epc.RollingStart(ctx); err != nil {
487 return nil, fmt.Errorf("cannot rolling-start: %w", err)
488 }
489 } else {
490 if err := epc.Start(ctx); err != nil {
491 return nil, fmt.Errorf("cannot start: %w", err)
492 }
493 }
494
495 for _, proc := range epc.Procs {
496 if cfg.GoFailEnabled && !proc.Failpoints().Enabled() {
497 epc.Close()
498 t.Skip("please run 'make gofail-enable && make build' before running the test")
499 }
500 }
501 if cfg.InitialLeaderIndex >= 0 {
502 if err := epc.MoveLeader(ctx, t, cfg.InitialLeaderIndex); err != nil {
503 return nil, fmt.Errorf("failed to move leader: %w", err)
504 }
505 }
506 return epc, nil
507}
508
509func (cfg *EtcdProcessClusterConfig) ClientScheme() string {
510 return setupScheme(cfg.BaseClientScheme, cfg.Client.ConnectionType == ClientTLS)

Callers 1

NewEtcdProcessClusterFunction · 0.85

Calls 8

RollingStartMethod · 0.80
ErrorfMethod · 0.65
StartMethod · 0.65
EnabledMethod · 0.65
FailpointsMethod · 0.65
CloseMethod · 0.65
SkipMethod · 0.65
MoveLeaderMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…