better logging and tighter assertions to debug jenkins-failing ServiceReplacerTest, and extracted unit test isolating the problem