mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
integration: remove unused parameters
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
This commit is contained in:
parent
42a1d4c3b6
commit
b7443ad849
@ -155,12 +155,12 @@ func (b *bridge) serveConn(bc *bridgeConn) {
|
||||
var wg sync.WaitGroup
|
||||
wg.Add(2)
|
||||
go func() {
|
||||
b.ioCopy(bc, bc.out, bc.in)
|
||||
b.ioCopy(bc.out, bc.in)
|
||||
bc.close()
|
||||
wg.Done()
|
||||
}()
|
||||
go func() {
|
||||
b.ioCopy(bc, bc.in, bc.out)
|
||||
b.ioCopy(bc.in, bc.out)
|
||||
bc.close()
|
||||
wg.Done()
|
||||
}()
|
||||
@ -200,7 +200,7 @@ func (b *bridge) Unblackhole() {
|
||||
}
|
||||
|
||||
// ref. https://github.com/golang/go/blob/master/src/io/io.go copyBuffer
|
||||
func (b *bridge) ioCopy(bc *bridgeConn, dst io.Writer, src io.Reader) (err error) {
|
||||
func (b *bridge) ioCopy(dst io.Writer, src io.Reader) (err error) {
|
||||
buf := make([]byte, 32*1024)
|
||||
for {
|
||||
select {
|
||||
|
@ -450,10 +450,10 @@ func (c *cluster) waitLeader(t *testing.T, membs []*member) int {
|
||||
return -1
|
||||
}
|
||||
|
||||
func (c *cluster) WaitNoLeader(t *testing.T) { c.waitNoLeader(t, c.Members) }
|
||||
func (c *cluster) WaitNoLeader() { c.waitNoLeader(c.Members) }
|
||||
|
||||
// waitNoLeader waits until given members lose leader.
|
||||
func (c *cluster) waitNoLeader(t *testing.T, membs []*member) {
|
||||
func (c *cluster) waitNoLeader(membs []*member) {
|
||||
noLeader := false
|
||||
for !noLeader {
|
||||
noLeader = true
|
||||
@ -992,7 +992,7 @@ func (m *member) Stop(t *testing.T) {
|
||||
}
|
||||
|
||||
// checkLeaderTransition waits for leader transition, returning the new leader ID.
|
||||
func checkLeaderTransition(t *testing.T, m *member, oldLead uint64) uint64 {
|
||||
func checkLeaderTransition(m *member, oldLead uint64) uint64 {
|
||||
interval := time.Duration(m.s.Cfg.TickMs) * time.Millisecond
|
||||
for m.s.Lead() == 0 || (m.s.Lead() == oldLead) {
|
||||
time.Sleep(interval)
|
||||
|
@ -41,7 +41,7 @@ func TestNetworkPartition5MembersLeaderInMinority(t *testing.T) {
|
||||
injectPartition(t, minorityMembers, majorityMembers)
|
||||
|
||||
// minority leader must be lost
|
||||
clus.waitNoLeader(t, minorityMembers)
|
||||
clus.waitNoLeader(minorityMembers)
|
||||
|
||||
// wait extra election timeout
|
||||
time.Sleep(2 * majorityMembers[0].ElectionTimeout())
|
||||
@ -89,7 +89,7 @@ func testNetworkPartition5MembersLeaderInMajority(t *testing.T) error {
|
||||
injectPartition(t, majorityMembers, minorityMembers)
|
||||
|
||||
// minority leader must be lost
|
||||
clus.waitNoLeader(t, minorityMembers)
|
||||
clus.waitNoLeader(minorityMembers)
|
||||
|
||||
// wait extra election timeout
|
||||
time.Sleep(2 * majorityMembers[0].ElectionTimeout())
|
||||
@ -128,7 +128,7 @@ func TestNetworkPartition4Members(t *testing.T) {
|
||||
injectPartition(t, leaderPartition, followerPartition)
|
||||
|
||||
// no group has quorum, so leader must be lost in all members
|
||||
clus.WaitNoLeader(t)
|
||||
clus.WaitNoLeader()
|
||||
|
||||
// recover network partition (bi-directional)
|
||||
recoverPartition(t, leaderPartition, followerPartition)
|
||||
|
@ -41,7 +41,7 @@ func testMoveLeader(t *testing.T, auto bool) {
|
||||
for i := range clus.Members {
|
||||
if oldLeadIdx != i {
|
||||
go func(m *member) {
|
||||
idc <- checkLeaderTransition(t, m, oldLeadID)
|
||||
idc <- checkLeaderTransition(m, oldLeadID)
|
||||
}(clus.Members[i])
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user