code & unit test for spark context hang detection logic

Not necessarily something you need to fix but a suggestion is to use the constructor pattern matching. So matching like so:

case SparkWorkesInfo(alive, dead) => {

then you could use the alive and dead variables instead of constantly accessing the case class variable.