Skip to content

Commit

Permalink
clean up server_test.go
Browse files Browse the repository at this point in the history
  • Loading branch information
xiang90 committed Jul 1, 2013
1 parent dac7811 commit 24fe106
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (

// Ensure that we can request a vote from a server that has not voted.
func TestServerRequestVote(t *testing.T) {
debugln("---TestServerRequestVote---")
server := newTestServer("1", &testTransporter{})
server.Initialize()
server.StartLeader()
Expand All @@ -33,7 +32,6 @@ func TestServerRequestVote(t *testing.T) {

// // Ensure that a vote request is denied if it comes from an old term.
func TestServerRequestVoteDeniedForStaleTerm(t *testing.T) {
debugln("---TestServerRequestVoteDeniedForStaleTerm---")
server := newTestServer("1", &testTransporter{})
server.Initialize()
server.StartLeader()
Expand All @@ -51,7 +49,6 @@ func TestServerRequestVoteDeniedForStaleTerm(t *testing.T) {

// // Ensure that a vote request is denied if we've already voted for a different candidate.
func TestServerRequestVoteDeniedIfAlreadyVoted(t *testing.T) {
debugln("---TestServerRequestVoteDeniedIfAlreadyVoted---")
server := newTestServer("1", &testTransporter{})
server.Initialize()
server.StartLeader()
Expand All @@ -69,7 +66,6 @@ func TestServerRequestVoteDeniedIfAlreadyVoted(t *testing.T) {

// // Ensure that a vote request is approved if vote occurs in a new term.
func TestServerRequestVoteApprovedIfAlreadyVotedInOlderTerm(t *testing.T) {
debugln("---TestServerRequestVoteApprovedIfAlreadyVotedInOlderTerm---")
server := newTestServer("1", &testTransporter{})
server.Initialize()
server.StartLeader()
Expand All @@ -87,7 +83,6 @@ func TestServerRequestVoteApprovedIfAlreadyVotedInOlderTerm(t *testing.T) {

// // Ensure that a vote request is denied if the log is out of date.
func TestServerRequestVoteDenyIfCandidateLogIsBehind(t *testing.T) {
debugln("---TestServerRequestVoteDenyIfCandidateLogIsBehind---")
server := newTestServerWithLog("1", &testTransporter{},
`cf4aab23 0000000000000001 0000000000000001 cmd_1 {"val":"foo","i":20}`+"\n"+
`4c08d91f 0000000000000002 0000000000000001 cmd_2 {"x":100}`+"\n"+
Expand Down Expand Up @@ -135,7 +130,6 @@ func TestServerPromoteSelf(t *testing.T) {

//Ensure that we can promote a server within a cluster to a leader.
func TestServerPromote(t *testing.T) {
debugln("---TestServerPromote---")
lookup := map[string]*Server{}
transporter := &testTransporter{}
transporter.sendVoteRequestFunc = func(server *Server, peer *Peer, req *RequestVoteRequest) (*RequestVoteResponse, error) {
Expand Down Expand Up @@ -163,7 +157,6 @@ func TestServerPromote(t *testing.T) {

// Ensure that a server will restart election if not enough votes are obtained before timeout.
func TestServerPromoteDoubleElection(t *testing.T) {
debugln("---TestServerPromoteDoubleElection---")
lookup := map[string]*Server{}
transporter := &testTransporter{}
transporter.sendVoteRequestFunc = func(server *Server, peer *Peer, req *RequestVoteRequest) (*RequestVoteResponse, error) {
Expand Down Expand Up @@ -333,7 +326,6 @@ func TestServerDenyCommandExecutionWhenFollower(t *testing.T) {

// Ensure that we can start a single server and append to its log.
func TestServerSingleNode(t *testing.T) {
debugln("-----SignalNodeTest-------")
server := newTestServer("1", &testTransporter{})
if server.state != Stopped {
t.Fatalf("Unexpected server state: %v", server.state)
Expand Down Expand Up @@ -368,8 +360,6 @@ func TestServerSingleNode(t *testing.T) {

// Ensure that we can start multiple servers and determine a leader.
func TestServerMultiNode(t *testing.T) {
debugln("------------MultiTest------------")

// Initialize the servers.
var mutex sync.Mutex
servers := map[string]*Server{}
Expand Down

0 comments on commit 24fe106

Please sign in to comment.