diff --git a/nomad/eval_broker_test.go b/nomad/eval_broker_test.go index 26cbcc4e5909..eea5c0ca1579 100644 --- a/nomad/eval_broker_test.go +++ b/nomad/eval_broker_test.go @@ -1508,8 +1508,8 @@ func TestEvalBroker_IntegrationTest(t *testing.T) { ci.Parallel(t) srv, cleanupS1 := TestServer(t, func(c *Config) { - c.NumSchedulers = 0 // Prevent dequeue - c.EvalReapCancelableInterval = 1 * time.Second // Ensure sweep-up + c.NumSchedulers = 0 // Prevent dequeue + c.EvalReapCancelableInterval = 10 * time.Minute // * time.Second // Ensure sweep-up }) defer cleanupS1() diff --git a/nomad/leader.go b/nomad/leader.go index c899940930ff..537372330bc6 100644 --- a/nomad/leader.go +++ b/nomad/leader.go @@ -1037,6 +1037,8 @@ func (s *Server) reapCancelableEvaluations(stopCh chan struct{}) chan struct{} { return wakeCh } +var cancelableEvalsBatchSize = structs.MaxUUIDsPerWriteRequest / 10 + // cancelCancelableEvals pulls a batch of cancelable evaluations from the eval // broker and updates their status to canceled. func cancelCancelableEvals(srv *Server) error { @@ -1046,7 +1048,7 @@ func cancelCancelableEvals(srv *Server) error { // We *can* send larger raft logs but rough benchmarks show that a smaller // page size strikes a balance between throughput and time we block the FSM // apply for other operations - cancelable := srv.evalBroker.Cancelable(structs.MaxUUIDsPerWriteRequest / 10) + cancelable := srv.evalBroker.Cancelable(cancelableEvalsBatchSize) if len(cancelable) > 0 { for i, eval := range cancelable { eval = eval.Copy()