Repository: etcd-io/etcd
File: server/etcdserver/server_test.go (Go)

Code before:
	cl.SetBackend(schema.NewMembershipBackend(lg, be))

	testdir := t.TempDir()
	if err := os.MkdirAll(testdir+"/member/snap", 0o755); err != nil {
		t.Fatalf("Couldn't make snap dir (%v)", err)
	}

	rs := raft.NewMemoryStorage()
	tr, snapDoneC := newSnapTransporter(lg, testdir)
	r := newRaftNode(raftNodeConfig{
		lg:          lg,
		isIDRemoved: func(id uint64) bool { return cl.IsIDRemoved(types.ID(id)) },
		Node:        n,
		transport:   tr,
		storage:     mockstorage.NewStorageRecorder(testdir),
		raftStorage: rs,
	})
	ci := cindex.NewConsistentIndex(be)
	s := &EtcdServer{
		lgMu: new(sync.RWMutex),
		lg:   lg,
		Cfg: config.ServerConfig{
			Logger:                 lg,
			DataDir:                testdir,
			SnapshotCatchUpEntries: DefaultSnapshotCatchUpEntries,
			ServerFeatureGate:      features.NewDefaultServerFeatureGate("TxnModeWriteWithSharedBuffer", nil),
		},
		r:                 *r,
		v2store:           st,
		snapshotter:       snap.New(lg, testdir),
		cluster:           cl,
		SyncTicker:        &time.Ticker{},
		consistIndex:      ci,
		beHooks:           serverstorage.NewBackendHooks(lg, ci),
		firstCommitInTerm: notify.NewNotifier(),
		lessor:            &lease.FakeLessor{},
		uberApply:         uberApplierMock{},
		authStore:         auth.NewAuthStore(lg, schema.NewAuthBackend(lg, be), nil, 1),
	}

	s.kv = mvcc.New(lg, be, &lease.FakeLessor{}, mvcc.StoreConfig{})
	s.be = be

	s.start()
	defer s.Stop()

	// submit applied entries and snap entries
	idx := uint64(0)
	outdated := 0
	accepted := 0
	for k := 1; k <= 101; k++ {

Review comment (suggestion):
```suggestion
			ServerFeatureGate:      features.NewDefaultServerFeatureGate("test", lg),
```

Code after:
	cl.SetBackend(schema.NewMembershipBackend(lg, be))

	testdir := t.TempDir()
	if err := os.MkdirAll(testdir+"/member/snap", 0o755); err != nil {
		t.Fatalf("Couldn't make snap dir (%v)", err)
	}

	rs := raft.NewMemoryStorage()
	tr, snapDoneC := newSnapTransporter(lg, testdir)
	r := newRaftNode(raftNodeConfig{
		lg:          lg,
		isIDRemoved: func(id uint64) bool { return cl.IsIDRemoved(types.ID(id)) },
		Node:        n,
		transport:   tr,
		storage:     mockstorage.NewStorageRecorder(testdir),
		raftStorage: rs,
	})
	ci := cindex.NewConsistentIndex(be)
	s := &EtcdServer{
		lgMu: new(sync.RWMutex),
		lg:   lg,
		Cfg: config.ServerConfig{
			Logger:                 lg,
			DataDir:                testdir,
			SnapshotCatchUpEntries: DefaultSnapshotCatchUpEntries,
			ServerFeatureGate:      features.NewDefaultServerFeatureGate("test", lg),
		},
		r:                 *r,
		v2store:           st,
		snapshotter:       snap.New(lg, testdir),
		cluster:           cl,
		SyncTicker:        &time.Ticker{},
		consistIndex:      ci,
		beHooks:           serverstorage.NewBackendHooks(lg, ci),
		firstCommitInTerm: notify.NewNotifier(),
		lessor:            &lease.FakeLessor{},
		uberApply:         uberApplierMock{},
		authStore:         auth.NewAuthStore(lg, schema.NewAuthBackend(lg, be), nil, 1),
	}

	s.kv = mvcc.New(lg, be, &lease.FakeLessor{}, mvcc.StoreConfig{})
	s.be = be

	s.start()
	defer s.Stop()

	// submit applied entries and snap entries
	idx := uint64(0)
	outdated := 0
	accepted := 0
	for k := 1; k <= 101; k++ {