PLT-198 Added a small delay to one of the web tests to allow the server to get fully set up

Этот коммит содержится в:
hmhealey
2015-09-11 10:43:33 -04:00
родитель 9b22cf31f1
Коммит 3edb4247e9

Просмотреть файл

@@ -36,9 +36,14 @@ func TearDown() {
func TestStatic(t *testing.T) {
Setup()
resp, _ := http.Get(URL + "/static/images/favicon.ico")
// add a short delay to make sure the server is ready to receive requests
time.Sleep(1 * time.Second)
if resp.StatusCode != http.StatusOK {
resp, err := http.Get(URL + "/static/images/favicon.ico")
if err != nil {
t.Fatalf("got error while trying to get static files %v", err)
} else if resp.StatusCode != http.StatusOK {
t.Fatalf("couldn't get static files %v", resp.StatusCode)
}
}