open-nomad/nomad
Tim Gross 977c88dcea
drainer: test refactoring to clarify behavior around delete/down nodes (#16612)
This changeset refactors the tests of the draining node watcher so that we don't
mock the node watcher's `Remove` and `Update` methods for its own tests. Instead
we'll mock the node watcher's dependencies (the job watcher and deadline
notifier) and now unit tests can cover the real code. This allows us to remove a
bunch of TODOs in `watch_nodes.go` around testing and clarify some important
behaviors:

* Nodes that are down or disconnected will still be watched until the scheduler
  decides what to do with their allocations. This will drive the job watcher but
  not the node watcher, and that lets the node watcher gracefully handle cases
  where a heartbeat fails but the node heartbeats again before its allocs can be
  evicted.

* Stop watching nodes that have been deleted. The blocking query for nodes set
  the maximum index to the highest index of a node it found, rather than the
  index of the nodes table. This misses updates to the index from deleting
  nodes. This was done as an performance optimization to avoid excessive
  unblocking, but because the query is over all nodes anyways there's no
  optimization to be had here. Remove the optimization so we can detect deleted
  nodes without having to wait for an update to an unrelated node.
2023-03-23 14:07:09 -04:00
..
deploymentwatcher
drainer drainer: test refactoring to clarify behavior around delete/down nodes (#16612) 2023-03-23 14:07:09 -04:00
mock acl: fix canonicalization of OIDC auth method mock (#16534) 2023-03-17 15:37:54 +01:00
state CSI: fix potential state store corruptions (#16256) 2023-02-27 08:47:08 -05:00
stream
structs client/metadata: fix crasher caused by AllowStale = false (#16549) 2023-03-20 16:32:32 -07:00
volumewatcher
acl.go acl: prevent privilege escalation via workload identity 2023-03-13 11:13:27 -04:00
acl_endpoint.go Update ioutil library references to os and io respectively for e2e helper nomad (#16332) 2023-03-08 09:39:03 -06:00
acl_endpoint_test.go Update ioutil library references to os and io respectively for e2e helper nomad (#16332) 2023-03-08 09:39:03 -06:00
acl_test.go acl: prevent privilege escalation via workload identity 2023-03-13 11:13:27 -04:00
alloc_endpoint.go
alloc_endpoint_test.go
autopilot.go
autopilot_oss.go
autopilot_test.go
blocked_evals.go
blocked_evals_stats.go
blocked_evals_stats_test.go
blocked_evals_system.go
blocked_evals_test.go
client_agent_endpoint.go
client_agent_endpoint_test.go
client_alloc_endpoint.go
client_alloc_endpoint_test.go
client_csi_endpoint.go
client_csi_endpoint_test.go
client_fs_endpoint.go
client_fs_endpoint_test.go
client_meta_endpoint.go client/metadata: fix crasher caused by AllowStale = false (#16549) 2023-03-20 16:32:32 -07:00
client_meta_endpoint_test.go client/metadata: fix crasher caused by AllowStale = false (#16549) 2023-03-20 16:32:32 -07:00
client_rpc.go
client_rpc_test.go
client_stats_endpoint.go
client_stats_endpoint_test.go
config.go build/cli: Add BuildDate (#16216) 2023-02-27 11:27:40 -06:00
consul.go
consul_oss_test.go
consul_policy.go
consul_policy_oss_test.go
consul_policy_test.go
consul_test.go
core_sched.go CSI: fix potential state store corruptions (#16256) 2023-02-27 08:47:08 -05:00
core_sched_test.go CSI: fix potential state store corruptions (#16256) 2023-02-27 08:47:08 -05:00
csi_endpoint.go handle `FSM.Apply` errors in `raftApply` (#16287) 2023-03-02 13:51:09 -05:00
csi_endpoint_test.go
deployment_endpoint.go
deployment_endpoint_test.go
deployment_watcher_shims.go
drainer_int_test.go
drainer_shims.go handle `FSM.Apply` errors in `raftApply` (#16287) 2023-03-02 13:51:09 -05:00
encrypter.go
encrypter_test.go
endpoints_oss.go
eval_broker.go
eval_broker_test.go
eval_endpoint.go
eval_endpoint_test.go
event_endpoint.go Update ioutil library references to os and io respectively for e2e helper nomad (#16332) 2023-03-08 09:39:03 -06:00
event_endpoint_test.go
fsm.go
fsm_oss.go
fsm_registry_oss.go
fsm_test.go
heartbeat.go
heartbeat_test.go
job_endpoint.go acl: update job eval requirement to `submit-job` (#16463) 2023-03-13 17:13:54 -04:00
job_endpoint_hook_connect.go
job_endpoint_hook_connect_test.go
job_endpoint_hook_expose_check.go
job_endpoint_hook_expose_check_test.go
job_endpoint_hook_vault.go
job_endpoint_hook_vault_oss.go
job_endpoint_hooks.go Allow configurable range of Job priorities (#16084) 2023-02-17 09:23:13 -05:00
job_endpoint_hooks_test.go Allow configurable range of Job priorities (#16084) 2023-02-17 09:23:13 -05:00
job_endpoint_oss.go
job_endpoint_oss_test.go
job_endpoint_test.go acl: update job eval requirement to `submit-job` (#16463) 2023-03-13 17:13:54 -04:00
job_endpoint_validators.go
job_endpoint_validators_test.go
keyring_endpoint.go handle `FSM.Apply` errors in `raftApply` (#16287) 2023-03-02 13:51:09 -05:00
keyring_endpoint_test.go
leader.go remove backcompat support for non-atomic job registration (#16305) 2023-03-03 15:52:22 -05:00
leader_oss.go
leader_test.go
merge.go
namespace_endpoint.go handle `FSM.Apply` errors in `raftApply` (#16287) 2023-03-02 13:51:09 -05:00
namespace_endpoint_test.go
node_endpoint.go scheduler: correctly detect inplace update with wildcard datacenters (#16362) 2023-03-07 10:05:59 -05:00
node_endpoint_test.go
operator_endpoint.go handle `FSM.Apply` errors in `raftApply` (#16287) 2023-03-02 13:51:09 -05:00
operator_endpoint_test.go Update ioutil library references to os and io respectively for e2e helper nomad (#16332) 2023-03-08 09:39:03 -06:00
periodic.go remove backcompat support for non-atomic job registration (#16305) 2023-03-03 15:52:22 -05:00
periodic_endpoint.go
periodic_endpoint_test.go
periodic_test.go
plan_apply.go
plan_apply_node_tracker.go
plan_apply_node_tracker_test.go
plan_apply_oss.go
plan_apply_pool.go
plan_apply_pool_test.go
plan_apply_test.go
plan_endpoint.go
plan_endpoint_test.go
plan_normalization_test.go
plan_queue.go
plan_queue_test.go
raft_rpc.go
regions_endpoint.go
regions_endpoint_test.go
rpc.go handle `FSM.Apply` errors in `raftApply` (#16287) 2023-03-02 13:51:09 -05:00
rpc_rate_metrics.go
rpc_test.go tls enforcement flaky tests (#16543) 2023-03-17 14:11:13 -05:00
scaling_endpoint.go
scaling_endpoint_test.go
search_endpoint.go
search_endpoint_oss.go
search_endpoint_test.go
serf.go
serf_test.go
server.go Update ioutil library references to os and io respectively for e2e helper nomad (#16332) 2023-03-08 09:39:03 -06:00
server_setup.go build/cli: Add BuildDate (#16216) 2023-02-27 11:27:40 -06:00
server_setup_oss.go
server_test.go
service_registration_endpoint.go service: fix regression in task access to list/read endpoint (#16316) 2023-03-03 11:41:19 -05:00
service_registration_endpoint_test.go service: fix regression in task access to list/read endpoint (#16316) 2023-03-03 11:41:19 -05:00
stats_fetcher.go
stats_fetcher_test.go
status_endpoint.go
status_endpoint_test.go
system_endpoint.go
system_endpoint_test.go
testing.go client/metadata: fix crasher caused by AllowStale = false (#16549) 2023-03-20 16:32:32 -07:00
testing_oss.go
timetable.go
timetable_test.go
util.go
util_test.go
variables_endpoint.go acl: prevent privilege escalation via workload identity 2023-03-13 11:13:27 -04:00
variables_endpoint_test.go acl: prevent privilege escalation via workload identity 2023-03-13 11:13:27 -04:00
vault.go
vault_test.go
vault_testing.go
worker.go
worker_string_schedulerworkerstatus.go
worker_string_workerstatus.go
worker_test.go