@NicolasDorier you may be right. I think that sync_with_ping() should be enough to make sure the node is sync'ed to the tip (p2p messages are processed sequentially and single threaded by bitcoind, so it shouldn't send a pong back until it's worked through all the block messages).
Sadly there aren't quite enough logs to see what's going on here. I'm going to leave this as it is for a few more nightly runs to see if we can get a better set of diags. This is in the extended test suite so it won't cause PR or merge travis builds to fail.
If I can't get to the bottom of why this is failing, I'll try with your change, but I'd like to understand what the problem is before trying your fix.