open-nomad/client
Mahmood Ali acbfeb5815 Simplify Bootstrap logic in tests
This change updates tests to honor `BootstrapExpect` exclusively when
forming test clusters and removes test only knobs, e.g.
`config.DevDisableBootstrap`.

Background:

Test cluster creation is fragile.  Test servers don't follow the
BootstapExpected route like production clusters.  Instead they start as
single node clusters and then get rejoin and may risk causing brain
split or other test flakiness.

The test framework expose few knobs to control those (e.g.
`config.DevDisableBootstrap` and `config.Bootstrap`) that control
whether a server should bootstrap the cluster.  These flags are
confusing and it's unclear when to use: their usage in multi-node
cluster isn't properly documented.  Furthermore, they have some bad
side-effects as they don't control Raft library: If
`config.DevDisableBootstrap` is true, the test server may not
immediately attempt to bootstrap a cluster, but after an election
timeout (~50ms), Raft may force a leadership election and win it (with
only one vote) and cause a split brain.

The knobs are also confusing as Bootstrap is an overloaded term.  In
BootstrapExpect, we refer to bootstrapping the cluster only after N
servers are connected.  But in tests and the knobs above, it refers to
whether the server is a single node cluster and shouldn't wait for any
other server.

Changes:

This commit makes two changes:

First, it relies on `BootstrapExpected` instead of `Bootstrap` and/or
`DevMode` flags.  This change is relatively trivial.

Introduce a `Bootstrapped` flag to track if the cluster is bootstrapped.
This allows us to keep `BootstrapExpected` immutable.  Previously, the
flag was a config value but it gets set to 0 after cluster bootstrap
completes.
2020-03-02 13:47:43 -05:00
..
allocdir connect: add unix socket to proxy grpc for envoy (#6232) 2019-09-03 08:43:38 -07:00
allochealth client: improve group service stanza interpolation and check_re… (#6586) 2019-11-18 13:04:01 -05:00
allocrunner update rest of consul packages 2020-02-16 16:25:04 -06:00
allocwatcher client/allocwatcher: fix dropped test error (#6592) 2019-10-31 08:29:25 -04:00
config command: use consistent CONSUL_HTTP_TOKEN name 2020-02-12 10:42:33 -06:00
consul comments: cleanup some leftover debug comments and such 2020-01-31 19:04:35 -06:00
devicemanager initialize device manager stats interval 2019-08-23 14:58:34 -04:00
fingerprint Update client/fingerprint/env_aws.go 2019-12-16 14:48:52 +01:00
interfaces Populate alloc stats API with device stats 2018-11-16 10:26:32 -05:00
lib ar: plumb client config for networking into the network hook 2019-07-31 01:04:06 -04:00
logmon logmon: add timeout to RPC operations 2019-12-02 10:33:05 -05:00
pluginmanager drivermanager: attempt dispense on reattachment failure 2020-02-15 00:50:06 -05:00
servers client: drop unused DC field from servers list 2019-05-20 14:19:15 -07:00
state tests: run_for is already a string 2020-01-28 14:58:57 -05:00
stats client: Return empty values when host stats fail 2019-09-19 01:22:07 +02:00
structs move shared structs out of client and into nomad 2020-01-09 15:15:05 -05:00
taskenv address review comments 2020-01-15 08:57:05 -05:00
testutil acl: check ACL against object namespace 2019-10-08 12:59:22 -04:00
vaultclient nomad: proxy requests for Service Identity tokens between Clients and Consul 2020-01-31 19:03:53 -06:00
acl.go aux: helper method that returns token as well as ACL policy 2019-04-30 10:23:56 -04:00
acl_test.go tests: swap lib/freeport for tweaked helper/freeport 2019-12-09 08:37:32 -06:00
agent_endpoint.go Rename profile package to pprof 2020-01-09 15:15:10 -05:00
agent_endpoint_test.go Rename profile package to pprof 2020-01-09 15:15:10 -05:00
alloc_endpoint.go acl: check ACL against object namespace 2019-10-08 12:59:22 -04:00
alloc_endpoint_test.go Merge pull request #6556 from hashicorp/c-vendor-multierror-20191025 2019-12-13 11:32:42 -05:00
alloc_watcher_e2e_test.go tests: swap lib/freeport for tweaked helper/freeport 2019-12-09 08:37:32 -06:00
client.go client: fix race accessing Node.status 2020-02-07 15:50:47 -08:00
client_stats_endpoint.go
client_stats_endpoint_test.go tests: swap lib/freeport for tweaked helper/freeport 2019-12-09 08:37:32 -06:00
client_test.go client: enable nomad client to request and set SI tokens for tasks 2020-01-31 19:03:38 -06:00
driver_manager_test.go tests: fix data race in client TestDriverManager_Fingerprint_Periodic 2019-05-21 09:49:56 -04:00
fingerprint_manager.go goimports until make check is happy 2019-01-23 06:27:14 -08:00
fingerprint_manager_test.go client/drivermananger: add driver manager 2018-12-18 22:55:18 -05:00
fs_endpoint.go acl: check ACL against object namespace 2019-10-08 12:59:22 -04:00
fs_endpoint_test.go tests: swap lib/freeport for tweaked helper/freeport 2019-12-09 08:37:32 -06:00
gc.go Plugins use parent loggers 2019-01-11 11:36:37 -08:00
gc_test.go tests: swap lib/freeport for tweaked helper/freeport 2019-12-09 08:37:32 -06:00
node_updater.go client: wait for batched driver updated 2019-04-19 09:00:24 -04:00
rpc.go agent pprof endpoints 2020-01-09 15:15:02 -05:00
rpc_test.go Simplify Bootstrap logic in tests 2020-03-02 13:47:43 -05:00
testing.go goimports until make check is happy 2019-01-23 06:27:14 -08:00
util.go client: defensive against getting stale alloc updates 2019-06-29 04:17:35 -05:00
util_test.go Update state with server 2018-10-16 16:53:29 -07:00