[1.5.X] Fixed lockups in jenkins, refs #19546.

Backport of ce580dd8ea04237cfe34cd02df0b8944a5345f4f from master.