diff --git a/pkg/config/config_test.go b/pkg/config/config_test.go index 3dfa81ef2..7c139ea8c 100644 --- a/pkg/config/config_test.go +++ b/pkg/config/config_test.go @@ -133,12 +133,7 @@ func TestConfigFromURL(t *testing.T) { }) go func() { - // returns ErrServerClosed on graceful close if err := srv.ListenAndServe(); err != http.ErrServerClosed { - // NOTE: there is a chance that next line won't have time to run, - // as main() doesn't wait for this goroutine to stop. don't use - // code with race conditions like these for production. see post - // comments below on more discussion on how to handle this. log.Fatalf("ListenAndServe(): %s", err) } }() @@ -146,14 +141,10 @@ func TestConfigFromURL(t *testing.T) { parsedConf, err = ParseFile("http://localhost:8081/exampleURL") assert.NoError(t, err, "Expected no error when parsing YAML from URL") if err := srv.Shutdown(context.TODO()); err != nil { - panic(err) // failure/timeout shutting down the server gracefully + panic(err) } testParsedConfig(t, &parsedConf) - //http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { - // fmt.Fprintf(w, resourceConfYAML1, html.EscapeString(r.URL.Path)) - //}) - //log.Fatal(http.ListenAndServe(":8081", nil)) } func testParsedConfig(t *testing.T, config *Configuration) {