There have been a few travis failures lately caused by the comparison tool losing its connection to bitcoind. Sample failure here: https://travis-ci.org/bitcoin/bitcoin/jobs/52724160
I believe I've been able to reproduce locally, and these changes fixed the issue I was experiencing.
- don't use -connect=0.0.0.0. This actually causes attempted connections to 0.0.0.0.
- Don't attempt to discover our IP. That's not needed here.
- With those two removed, the timings are changed such that the previous watchdog didn't always work. Use proper tail/grep semantics to ensure that grep always exits quickly.
Before these changes, I was able to locally reproduce a test failure ~10% of the time. After, I'm unable to see a failure.