Added seconds_to_wait for flexible testing, and fixed problem with the test itself