Fail job if number of tasks failed exceeds threshold

I presume integer division is fine here?