Files
nomad/command/agent
Mahmood Ali 85a1bb49f3 tests: deflake some SetServer related tests
Some tests assert on numbers on numbers of servers, e.g.
TestHTTP_AgentSetServers and TestHTTP_AgentListServers_ACL . Though, in dev and
test modes, the agent starts with servers having duplicate entries for
advertised and normalized RPC values, then settles with one unique value after
Raft/Serf re-sets servers with one single unique value.

This leads to flakiness, as the test will fail if assertion runs before Serf
update takes effect.

Here, we update the inital dev handling so it only adds a unique value if the
advertised and normalized values are the same.

Sample log lines illustrating the problem:

```
=== CONT  TestHTTP_AgentSetServers
    TestHTTP_AgentSetServers: testlog.go:34: 2020-04-06T21:47:51.016Z [INFO]  nomad.raft: initial configuration: index=1 servers="[{Suffrage:Voter ID:127.0.0.1:9008 Address:127.0.0.1:9008}]"
    TestHTTP_AgentSetServers: testlog.go:34: 2020-04-06T21:47:51.016Z [INFO]  nomad: serf: EventMemberJoin: TestHTTP_AgentSetServers.global 127.0.0.1
    TestHTTP_AgentSetServers: testlog.go:34: 2020-04-06T21:47:51.035Z [DEBUG] client.server_mgr: new server list: new_servers=[127.0.0.1:9008, 127.0.0.1:9008] old_servers=[]
...
    TestHTTP_AgentSetServers: agent_endpoint_test.go:759:
                Error Trace:    agent_endpoint_test.go:759
                                                        http_test.go:1089
                                                        agent_endpoint_test.go:705
                Error:          "[127.0.0.1:9008 127.0.0.1:9008]" should have 1 item(s), but has 2
                Test:           TestHTTP_AgentSetServers
```
2020-04-07 09:27:48 -04:00
..
2020-01-09 15:15:10 -05:00
2018-03-11 17:43:19 +00:00
2017-10-13 13:12:20 -07:00
2020-03-25 10:53:38 -04:00
2020-03-28 12:01:51 -04:00
2018-03-11 18:35:30 +00:00
2018-10-16 16:56:55 -07:00
2020-03-27 09:35:10 -04:00
2016-10-17 10:48:04 -07:00
2017-07-20 09:36:34 -07:00
2018-09-13 10:43:40 -07:00
2020-02-16 16:04:59 -06:00
2017-07-20 09:36:34 -07:00
2018-09-13 10:43:40 -07:00
2018-09-13 10:43:40 -07:00
2017-09-07 17:04:21 -07:00
2018-02-15 13:59:02 -08:00
2017-07-20 09:36:34 -07:00
2015-09-06 18:39:03 -07:00
2017-09-19 10:08:23 -05:00
2019-01-22 15:44:31 -08:00
2019-01-22 15:44:31 -08:00
2017-07-20 09:36:34 -07:00
2020-03-02 13:47:43 -05:00