Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
dadgar committed Feb 2, 2016
1 parent 0d1b5f8 commit 95e6a62
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 6 additions & 1 deletion api/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ func assertWriteMeta(t *testing.T, wm *WriteMeta) {

func testJob() *Job {
task := NewTask("task1", "exec").
Require(&Resources{MemoryMB: 256})
Require(&Resources{
CPU: 100,
MemoryMB: 256,
DiskMB: 25,
IOPS: 10,
})

group := NewTaskGroup("group1", 1).
AddTask(task)
Expand Down
4 changes: 2 additions & 2 deletions nomad/structs/structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -634,8 +634,8 @@ func (r *Resources) MeetsMinResources() error {
if r.DiskMB < 10 {
mErr.Errors = append(mErr.Errors, fmt.Errorf("minimum DiskMB value is 10; got %d", r.DiskMB))
}
if r.IOPS < 1 {
mErr.Errors = append(mErr.Errors, fmt.Errorf("minimum IOPS value is 1; got %d", r.IOPS))
if r.IOPS < 0 {
mErr.Errors = append(mErr.Errors, fmt.Errorf("minimum IOPS value is 0; got %d", r.IOPS))
}
for i, n := range r.Networks {
if err := n.MeetsMinResources(); err != nil {
Expand Down

0 comments on commit 95e6a62

Please sign in to comment.