Code review comment for lp:~elopio/snappy/test_go_xkcd

Revision history for this message
Leo Arias (elopio) wrote :

I removed the sleep and it failed. But the systemd service is running, the problem is that it takes some time between the service starting (i.e., the main method being run) and the port to be ready and listening. So we could poll for the port 80 to be ready, that is for http.Get("http://localhost") to return no error.
I found this nice example with the ticker http://3.bp.blogspot.com/-XzfNd-eL6zc/VVq6Im6XmpI/AAAAAAAAGvM/DuSXnY3dzUg/s1600/Screenshot%2Bfrom%2B2015-05-19%2B00%3A20%3A33.png

But, as we only need one second tops, it will tick only once. Or we could make the ticks smaller, but in this test waiting less than a second doesn't change anything.

So I left the sleep for simplicity, but reported a bug so we can remove it at some point.

« Back to merge proposal