Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minor fix for raft test #61

Merged
merged 1 commit into from
Jun 2, 2023
Merged

minor fix for raft test #61

merged 1 commit into from
Jun 2, 2023

Conversation

kikimo
Copy link
Contributor

@kikimo kikimo commented May 27, 2023

The msg type check and reject check at the end of TestLearnerCanVote is incorrect

@kikimo kikimo force-pushed the fix-raft-test branch 2 times, most recently from 0476e73 to b03beda Compare May 28, 2023 08:42
@kikimo kikimo changed the title fix error in TestLearnerCanVote minor fix for raft test May 31, 2023
Copy link
Member

@ahrtr ahrtr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Thanks @kikimo

raft_test.go Outdated
Comment on lines 465 to 470
t.Fatalf("expected exactly one message, not %+v", msgs)
}
msg := msgs[0]
if msg.Type != pb.MsgVoteResp && !msg.Reject {
if msg.Type != pb.MsgVoteResp || msg.Reject {
t.Fatal("expected learner to not reject vote")
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While here, could convert this to use the require package:

require.Len(t, msgs, 1)
require.Equal(t, msgs[0].Type, pb.MsgVoteResp)
require.False(t, msgs[0].Reject, "expected learner to not reject vote")

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed to use require pkg already

@ahrtr
Copy link
Member

ahrtr commented Jun 1, 2023

Could you squash the commits?

@kikimo
Copy link
Contributor Author

kikimo commented Jun 2, 2023

Could you squash the commits?

Squashed.

@ahrtr ahrtr merged commit 3e6cb62 into etcd-io:main Jun 2, 2023
@kikimo kikimo deleted the fix-raft-test branch June 10, 2023 01:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants