Skip to content

Commit

Permalink
addressed comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mihir20 committed Mar 14, 2024
1 parent c94723d commit eb8c236
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions testhelper/docker/resource/transformer/transformer.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

"github.com/samber/lo"

dockerTestHelper "github.com/rudderlabs/rudder-go-kit/testhelper/docker"
dockertesthelper "github.com/rudderlabs/rudder-go-kit/testhelper/docker"

"github.com/ory/dockertest/v3"
"github.com/ory/dockertest/v3/docker"
Expand Down Expand Up @@ -58,7 +58,7 @@ func WithUserTransformations(transformations map[string]string, cleaner resource
return func(conf *config) {
backendConfigSvc := newTestBackendConfigServer(transformations)

conf.setBackendConfigURL(dockerTestHelper.ToInternalDockerHost(backendConfigSvc.URL))
conf.setBackendConfigURL(dockertesthelper.ToInternalDockerHost(backendConfigSvc.URL))
conf.extraHosts = append(conf.extraHosts, "host.docker.internal:host-gateway")
cleaner.Cleanup(func() {
backendConfigSvc.Close()
Expand All @@ -78,7 +78,7 @@ func WithConnectionToHostEnabled() func(*config) {
// WithConfigBackendURL should not be used with WithUserTransformations option
func WithConfigBackendURL(url string) func(*config) {
return func(conf *config) {
conf.setBackendConfigURL(dockerTestHelper.ToInternalDockerHost(url))
conf.setBackendConfigURL(dockertesthelper.ToInternalDockerHost(url))
}
}

Expand Down
4 changes: 2 additions & 2 deletions testhelper/httptest/httptest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func TestUnStartedServer(t *testing.T) {
resp, err := http.Get("http://" + httpUnStartedServer.Listener.Addr().String())
defer func() { httputil.CloseResponse(resp) }()
return err == nil
}, 5*time.Second, time.Second, "connected to an un-started server")
}, 5*time.Second, 10*time.Millisecond, "connected to an un-started server")

// start the server now
httpUnStartedServer.Start()
Expand All @@ -72,7 +72,7 @@ func TestUnStartedServer(t *testing.T) {
body, err = io.ReadAll(resp.Body)
}
return err == nil
}, 5*time.Second, time.Second, "failed to connect to server")
}, 2*time.Second, 100*time.Millisecond, "failed to connect to server")

require.Equal(t, http.StatusOK, statusCode)
require.Equal(t, "Hello, world!", string(body))
Expand Down

0 comments on commit eb8c236

Please sign in to comment.