Re-work periodic connection recovery, make related tests more robust