X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/4a2dc82a1acce855151928abe0030e1dd7dbf728..e2cc6c1935565ee965f38501a4974e9d0e6b29e5:/services/crunch-dispatch-slurm/crunch-dispatch-slurm_test.go diff --git a/services/crunch-dispatch-slurm/crunch-dispatch-slurm_test.go b/services/crunch-dispatch-slurm/crunch-dispatch-slurm_test.go index 23a8a0ca01..719ec98d27 100644 --- a/services/crunch-dispatch-slurm/crunch-dispatch-slurm_test.go +++ b/services/crunch-dispatch-slurm/crunch-dispatch-slurm_test.go @@ -55,11 +55,12 @@ func (s *IntegrationSuite) TearDownTest(c *C) { } type slurmFake struct { - didBatch [][]string - didCancel []string - didRelease []string - didRenice [][]string - queue string + didBatch [][]string + didCancel []string + didRelease []string + didRenice [][]string + queue string + rejectNice10K bool // If non-nil, run this func during the 2nd+ call to Cancel() onCancel func() // Error returned by Batch() @@ -82,6 +83,9 @@ func (sf *slurmFake) Release(name string) error { func (sf *slurmFake) Renice(name string, nice int64) error { sf.didRenice = append(sf.didRenice, []string{name, fmt.Sprintf("%d", nice)}) + if sf.rejectNice10K && nice > 10000 { + return errors.New("scontrol: error: Invalid nice value, must be between -10000 and 10000") + } return nil }