mirror of
https://github.com/kemko/nomad.git
synced 2026-01-05 18:05:42 +03:00
fix typo and add one more test scenario
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user