Currently the test takes 5*5=25 seconds. Re-arrange the code so that it's possible to change the retry delay in tests. Change-Id: Ia559dad4bc656f8ad6b2cb8cb0137a97e2614db7