Add rand_sleep function to the test module