open-consul/agent
Frank Schroeder 0ed76615d3 rpc: monkey patch fix for data races for localState
The tests that use the localState of the agent access the internal
variables and call methods which are not guarded by locks creating
data races in tests. While the use of internal variables is somewhat
easy to spot the fact that not all methods are thread-safe is a
surprise.

A proper fix requires the localState struct to be moved into its own
package so that tests in the agent can only access the external
interface.

However, the localState is currently dependent on the agent.Config
which would create a circular dependency. Therefore, the Config
struct needs to be moved first for this to happen.

This patch literally monkey patches the use of the lock around the
cases which have data races and marks them with a
// todo(fs): data race comment.
2017-07-07 09:22:34 +02:00
..
consul rpc: try shutting down leader first to avoid hang in TestLeader_LeftServer 2017-07-07 09:22:34 +02:00
mock pkg refactor 2017-06-10 18:52:45 +02:00
pool agent: move conn pool for muxed connections into separate pkg 2017-06-21 05:42:39 +02:00
systemd agent: notify systemd after JoinLAN (#2121) 2017-06-21 06:43:55 +02:00
acl.go agent: make the RPC endpoint overwrite mechanism more transparent 2017-06-21 05:42:39 +02:00
acl_endpoint.go pkg refactor 2017-06-10 18:52:45 +02:00
acl_endpoint_test.go pkg refactor 2017-06-10 18:52:45 +02:00
acl_test.go agent: make registerEndpoint private 2017-06-21 05:42:39 +02:00
agent.go Fix missing formatting directive causing go vet to fail 2017-06-27 16:32:38 -05:00
agent_endpoint.go agent: fix 'consul leave' shutdown race (#2880) 2017-06-21 05:52:51 +02:00
agent_endpoint_test.go Removes some useless comments. 2017-06-25 10:32:35 -07:00
agent_test.go rpc: monkey patch fix for data races for localState 2017-07-07 09:22:34 +02:00
bindata_assetfs.go Fixes checked in web assets and associated build scripts. (#3173) 2017-06-21 14:43:07 -07:00
catalog_endpoint.go agent: refactor: make address translation part of the agent 2017-07-07 09:22:34 +02:00
catalog_endpoint_test.go rpc: monkey patch fix for data races for localState 2017-07-07 09:22:34 +02:00
check.go Correctly forward Host header in healthcheck (#3203) 2017-06-29 16:26:08 -07:00
check_test.go agent: refactor: use handler for test http tls server 2017-07-07 09:22:34 +02:00
config.go Revert "agent: add allowStale option for HTTP API (#3142)" 2017-06-27 07:04:55 +02:00
config_aws.go Revert "discover: move instance discover code into separate package (#3144)" (#3180) 2017-06-23 01:38:55 -07:00
config_azure.go Revert "discover: move instance discover code into separate package (#3144)" (#3180) 2017-06-23 01:38:55 -07:00
config_azure_test.go Revert "discover: move instance discover code into separate package (#3144)" (#3180) 2017-06-23 01:38:55 -07:00
config_ec2_test.go Revert "discover: move instance discover code into separate package (#3144)" (#3180) 2017-06-23 01:38:55 -07:00
config_gce.go Revert "discover: move instance discover code into separate package (#3144)" (#3180) 2017-06-23 01:38:55 -07:00
config_gce_test.go Revert "discover: move instance discover code into separate package (#3144)" (#3180) 2017-06-23 01:38:55 -07:00
config_test.go Changes host-based node IDs from opt-out to opt-in. (#3187) 2017-06-24 09:36:53 -07:00
coordinate_endpoint.go pkg refactor 2017-06-10 18:52:45 +02:00
coordinate_endpoint_test.go pkg refactor 2017-06-10 18:52:45 +02:00
dns.go agent: refactor: make address translation part of the agent 2017-07-07 09:22:34 +02:00
dns_test.go agent: fix DNS recursor tests (#3190) 2017-06-25 10:42:37 -07:00
event_endpoint.go pkg refactor 2017-06-10 18:52:45 +02:00
event_endpoint_test.go pkg refactor 2017-06-10 18:52:45 +02:00
health_endpoint.go agent: refactor: make address translation part of the agent 2017-07-07 09:22:34 +02:00
health_endpoint_test.go pkg refactor 2017-06-10 18:52:45 +02:00
http.go Revert "agent: add allowStale option for HTTP API (#3142)" 2017-06-27 07:04:55 +02:00
http_test.go Revert "agent: add allowStale option for HTTP API (#3142)" 2017-06-27 07:04:55 +02:00
keyring.go pkg refactor 2017-06-10 18:52:45 +02:00
keyring_test.go pkg refactor 2017-06-10 18:52:45 +02:00
kvs_endpoint.go pkg refactor 2017-06-10 18:52:45 +02:00
kvs_endpoint_test.go pkg refactor 2017-06-10 18:52:45 +02:00
local.go agent: use the delegate interface for local state 2017-06-21 05:42:39 +02:00
local_test.go rpc: monkey patch fix for data races for localState 2017-07-07 09:22:34 +02:00
notify.go agent: move NotifyGroup into the agent pkg 2017-06-21 05:42:39 +02:00
notify_test.go agent: move NotifyGroup into the agent pkg 2017-06-21 05:42:39 +02:00
operator_endpoint.go pkg refactor 2017-06-10 18:52:45 +02:00
operator_endpoint_test.go pkg refactor 2017-06-10 18:52:45 +02:00
prepared_query_endpoint.go agent: refactor: make address translation part of the agent 2017-07-07 09:22:34 +02:00
prepared_query_endpoint_test.go agent: make registerEndpoint private 2017-06-21 05:42:39 +02:00
remote_exec.go pkg refactor 2017-06-10 18:52:45 +02:00
remote_exec_test.go pkg refactor 2017-06-10 18:52:45 +02:00
retry_join.go Revert "discover: move instance discover code into separate package (#3144)" (#3180) 2017-06-23 01:38:55 -07:00
session_endpoint.go pkg refactor 2017-06-10 18:52:45 +02:00
session_endpoint_test.go pkg refactor 2017-06-10 18:52:45 +02:00
snapshot_endpoint.go pkg refactor 2017-06-10 18:52:45 +02:00
snapshot_endpoint_test.go pkg refactor 2017-06-10 18:52:45 +02:00
status_endpoint.go pkg refactor 2017-06-10 18:52:45 +02:00
status_endpoint_test.go pkg refactor 2017-06-10 18:52:45 +02:00
testagent.go agent: fix 'consul leave' shutdown race (#2880) 2017-06-21 05:52:51 +02:00
translate_addr.go agent: refactor: make address translation part of the agent 2017-07-07 09:22:34 +02:00
txn_endpoint.go pkg refactor 2017-06-10 18:52:45 +02:00
txn_endpoint_test.go pkg refactor 2017-06-10 18:52:45 +02:00
ui_endpoint.go pkg refactor 2017-06-10 18:52:45 +02:00
ui_endpoint_test.go pkg refactor 2017-06-10 18:52:45 +02:00
user_event.go pkg refactor 2017-06-10 18:52:45 +02:00
user_event_test.go pkg refactor 2017-06-10 18:52:45 +02:00
util.go pkg refactor 2017-06-10 18:52:45 +02:00
util_test.go pkg refactor 2017-06-10 18:52:45 +02:00
watch_handler.go pkg refactor 2017-06-10 18:52:45 +02:00
watch_handler_test.go pkg refactor 2017-06-10 18:52:45 +02:00