Add retry logic for Publishtests

@Praburaj 

adding retry logic as discussed
ah i see. I have removed the comment