Skip to content

Commit

Permalink
more hacking ci
Browse files Browse the repository at this point in the history
  • Loading branch information
tgross committed Feb 9, 2023
1 parent 64c3887 commit 2268e8c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions nomad/eval_broker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 3 additions & 1 deletion nomad/leader.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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()
Expand Down

0 comments on commit 2268e8c

Please sign in to comment.