fix and test stale job flushing