open-nomad/command/agent
Mahmood Ali 14d6fec05a 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
..
consul connect: fix bug where absent connect.proxy stanza needs default config 2020-04-01 11:19:32 -06:00
event make auditor interface more explicit 2020-03-23 19:32:58 -04:00
monitor unlock before returning, no need for label 2019-11-05 11:44:29 -05:00
pprof Rename profile package to pprof 2020-01-09 15:15:10 -05:00
test-resources chore: Format hcl configurations 2019-07-20 16:55:07 +02:00
testdata agent config parsing tests for scheduler config 2020-04-03 07:54:32 -04:00
acl_endpoint.go Self token lookup 2017-10-13 13:12:20 -07:00
acl_endpoint_test.go spelling: bootstrap 2018-03-11 17:43:19 +00:00
agent.go tests: deflake some SetServer related tests 2020-04-07 09:27:48 -04:00
agent_endpoint.go fixup! vendor: explicit use of hashicorp/go-msgpack 2020-03-31 09:48:07 -04:00
agent_endpoint_test.go tests: deflake some SetServer related tests 2020-04-07 09:27:48 -04:00
agent_oss.go allow all build contexts to use noOpAuditor 2020-03-25 10:38:40 -04:00
agent_test.go add in change missed from ent 2020-03-25 10:53:38 -04:00
alloc_endpoint.go fixup! backend: support WS authentication handshake in alloc/exec 2020-04-03 14:20:31 -04:00
alloc_endpoint_test.go backend: support WS authentication handshake in alloc/exec 2020-04-03 11:18:54 -04:00
bindata_assetfs.go refactor api profile methods 2020-01-09 15:15:12 -05:00
command.go Audit config, seams for enterprise audit features 2020-03-23 13:47:42 -04:00
command_test.go refactored config validation into a new method, modified Meta.Client 2019-01-08 15:07:36 +00:00
config.go windows: support -dev mode 2020-03-28 12:01:51 -04:00
config_oss.go Allow separate enterprise config overlay 2018-03-22 13:53:08 -07:00
config_parse.go fix compilation with correct func 2020-03-23 14:32:11 -04:00
config_parse_test.go agent config parsing tests for scheduler config 2020-04-03 07:54:32 -04:00
config_test.go Audit config, seams for enterprise audit features 2020-03-23 13:47:42 -04:00
csi_endpoint.go csi: return an empty result list from plugins & volumes without type, not an error (#7471) 2020-03-24 14:28:28 -04:00
deployment_endpoint.go Populate DisplayMessage in various http endpoints that return allocations, plus unit tests. 2017-11-17 14:53:26 -06:00
deployment_endpoint_test.go Populate DisplayMessage in various http endpoints that return allocations, plus unit tests. 2017-11-17 14:53:26 -06:00
eval_endpoint.go
eval_endpoint_test.go spelling: output 2018-03-11 18:35:30 +00:00
fs_endpoint.go fixup! vendor: explicit use of hashicorp/go-msgpack 2020-03-31 09:48:07 -04:00
fs_endpoint_test.go test: assert fs endpoints are xss safe 2020-03-25 09:45:43 -04:00
helpers.go client: expose task state to client 2018-10-16 16:56:55 -07:00
helpers_test.go test: fix missing agent shutdowns 2020-02-07 15:50:53 -08:00
http.go fixup! vendor: explicit use of hashicorp/go-msgpack 2020-03-31 09:48:07 -04:00
http_oss.go wrap http.Handlers 2020-03-27 09:35:10 -04:00
http_test.go fixup! vendor: explicit use of hashicorp/go-msgpack 2020-03-31 09:48:07 -04:00
job_endpoint.go adding raft and state_store support to track job scaling events 2020-04-01 16:15:14 +00:00
job_endpoint_test.go adding raft and state_store support to track job scaling events 2020-04-01 16:15:14 +00:00
keyring.go
keyring_test.go Standardize retrieving a free port into a helper package 2017-10-23 16:48:20 -07:00
log_file.go logging: Correctly track number of written bytes 2019-10-10 14:02:14 +02:00
log_file_test.go logging: Sort files when pruning old logs 2019-10-10 13:51:16 +02:00
log_levels.go Support for hot reloading log levels 2019-07-24 13:37:08 +02:00
log_levels_test.go More parallel 2017-07-20 09:36:34 -07:00
metrics_endpoint.go agent + consul 2018-09-13 10:43:40 -07:00
metrics_endpoint_test.go test: fix flaky TestHTTP_FreshClientAllocMetrics 2020-02-07 15:50:53 -08:00
node_endpoint.go take NodeID from url in api for node eligibility 2019-07-15 18:34:53 +03:00
node_endpoint_test.go tests: remove TestHTTP_NodeDrain_Compat 2020-03-30 07:06:52 -04:00
operator_endpoint.go implement MinQuorum 2020-02-16 16:04:59 -06:00
operator_endpoint_test.go update rest of consul packages 2020-02-16 16:25:04 -06:00
plugins.go move pluginutils -> helper/pluginutils 2019-01-22 15:50:08 -08:00
region_endpoint.go
region_endpoint_test.go More parallel 2017-07-20 09:36:34 -07:00
retry_join.go agent + consul 2018-09-13 10:43:40 -07:00
retry_join_test.go agent + consul 2018-09-13 10:43:40 -07:00
scaling_endpoint.go bad conversion between api.ScalingPolicy and structs.ScalingPolicy meant 2020-03-24 14:39:06 +00:00
scaling_endpoint_test.go fixed http endpoints for job.register and job.scalestatus 2020-03-24 13:57:16 +00:00
search_endpoint.go Sync namespace changes 2017-09-07 17:04:21 -07:00
search_endpoint_test.go add deployments to search api 2017-08-21 15:20:55 +00:00
stats_endpoint.go Server side impl + touch ups 2018-02-15 13:59:02 -08:00
stats_endpoint_test.go Fix failing test TestClientStatusRequest 2018-05-30 15:11:54 -05:00
status_endpoint.go
status_endpoint_test.go More parallel 2017-07-20 09:36:34 -07:00
stub_asset.go sync 2017-09-19 10:08:23 -05:00
syslog.go goimports 2019-01-22 15:44:31 -08:00
syslog_test.go goimports 2019-01-22 15:44:31 -08:00
system_endpoint.go
system_endpoint_test.go More parallel 2017-07-20 09:36:34 -07:00
testagent.go Simplify Bootstrap logic in tests 2020-03-02 13:47:43 -05:00
testingutils_test.go command/agent: Prune Dead Code (#6682) 2019-11-13 08:20:01 -05:00