Skip to content

Commit

Permalink
Fix replication integration tests cleanup
Browse files Browse the repository at this point in the history
Leader connections should be removed from the registry.
  • Loading branch information
freeekanayaka committed Aug 14, 2018
1 parent 47fd3d0 commit 2a2bfc1
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions internal/replication/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1403,7 +1403,6 @@ func TestIntegration_Snapshot(t *testing.T) {
require.NoError(t, err)

// XXX TODO: the Barrier() call below hangs.
return

// The follower will now have to restore the snapshot.
control.Barrier()
Expand Down Expand Up @@ -1770,9 +1769,13 @@ func newCluster(t *testing.T, opts ...clusterOption) (clusterConns, *rafttest.Co
}

cleanup := func() {
for i := range conns {
conns[i][0].Close()
conns[i][1].Close()
for id := range conns {
i, _ := strconv.Atoi(string(id))
registry := registries[i]
registry.ConnLeaderDel(conns[id][0])
registry.ConnLeaderDel(conns[id][1])
conns[id][0].Close()
conns[id][1].Close()
//require.NoError(t, conns[i][0].Close())
//require.NoError(t, conns[i][1].Close())
}
Expand Down

0 comments on commit 2a2bfc1

Please sign in to comment.