Skip to content

Commit

Permalink
fix typo and add one more test scenario
Browse files Browse the repository at this point in the history
  • Loading branch information
Preetha Appan committed May 8, 2019
1 parent 12e1804 commit 5bfa35a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion client/servers/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ func (m *Manager) SetServers(servers Servers) bool {
// Determine if they are equal
equal := m.serversAreEqual(servers)

// If server list is equal don't change the list and return immediatly
// If server list is equal don't change the list and return immediately
// This prevents unnecessary shuffling of a failed server that was moved to the
// bottom of the list
if equal {
Expand Down
5 changes: 5 additions & 0 deletions client/servers/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ func TestServers_SetServers(t *testing.T) {
require.False(m.SetServers([]*servers.Server{s1, s2}))
after := m.GetServers()
require.Equal(before, after)

// Send a shuffled list, verify original order doesn't change
require.False(m.SetServers([]*servers.Server{s2, s1}))
afterShuffledInput := m.GetServers()
require.Equal(after, afterShuffledInput)
}

func TestServers_FindServer(t *testing.T) {
Expand Down

0 comments on commit 5bfa35a

Please sign in to comment.