Fixed flakey tests

Assuming return value of time() and microtime() will increment by 1 when called every time, some issues will appear. (microtime(true) - $time will always greater than 1.) Also, $config is possible to be null when calling set_config.
Which problem is this causing? If the second call of microctime(true) is greater than $time + 1, it will skip the loop and end this test.
If it takes more than a second from the assignment of microtime() to $time to the while loop, then something is wrong with your machine.