Skip to content

Commit

Permalink
Tests: unique docker env name for tenant tests (thanos-io#7038)
Browse files Browse the repository at this point in the history
The e2e tests would occasionally fail due to non-unqiue docker environment
names. With this commit the tests are environments are given unique names
to avoid these failures.

Signed-off-by: Jacob Baungard Hansen <[email protected]>
Signed-off-by: hanyuting8 <[email protected]>
  • Loading branch information
jacobbaungard authored and hanyuting8 committed Jan 19, 2024
1 parent 83312ec commit ab93ce0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions test/e2e/query_frontend_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1034,12 +1034,12 @@ func (u tenantRoundTripper) RoundTrip(r *http.Request) (*http.Response, error) {
func TestTenantQFEHTTPMetrics(t *testing.T) {
t.Parallel()

e, err := e2e.NewDockerEnvironment("tenant-metrics")
e, err := e2e.NewDockerEnvironment("qfetenantmetrics")
testutil.Ok(t, err)
t.Cleanup(e2ethanos.CleanScenario(t, e))

// scrape the local prometheus, and our querier metrics
prom1, sidecar1 := e2ethanos.NewPrometheusWithSidecar(e, "alone", e2ethanos.DefaultPromConfig("prom-alone", 0, "", "", e2ethanos.LocalPrometheusTarget, "tenant-metrics-querier-1:8080"), "", e2ethanos.DefaultPrometheusImage(), "")
prom1, sidecar1 := e2ethanos.NewPrometheusWithSidecar(e, "alone", e2ethanos.DefaultPromConfig("prom-alone", 0, "", "", e2ethanos.LocalPrometheusTarget, "qfetenantmetrics-querier-1:8080"), "", e2ethanos.DefaultPrometheusImage(), "")

q := e2ethanos.NewQuerierBuilder(e, "1", sidecar1.InternalEndpoint("grpc")).Init()
testutil.Ok(t, e2e.StartAndWaitReady(q))
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2420,12 +2420,12 @@ func TestSidecarPrefersExtLabels(t *testing.T) {
func TestTenantHTTPMetrics(t *testing.T) {
t.Parallel()

e, err := e2e.NewDockerEnvironment("tenant-metrics")
e, err := e2e.NewDockerEnvironment("q-tenant-metrics")
testutil.Ok(t, err)
t.Cleanup(e2ethanos.CleanScenario(t, e))

// scrape the local prometheus, and our querier metrics
prom1, sidecar1 := e2ethanos.NewPrometheusWithSidecar(e, "alone", e2ethanos.DefaultPromConfig("prom-alone", 0, "", "", e2ethanos.LocalPrometheusTarget, "tenant-metrics-querier-1:8080"), "", e2ethanos.DefaultPrometheusImage(), "")
prom1, sidecar1 := e2ethanos.NewPrometheusWithSidecar(e, "alone", e2ethanos.DefaultPromConfig("prom-alone", 0, "", "", e2ethanos.LocalPrometheusTarget, "q-tenant-metrics-querier-1:8080"), "", e2ethanos.DefaultPrometheusImage(), "")

q := e2ethanos.NewQuerierBuilder(e, "1", sidecar1.InternalEndpoint("grpc")).Init()
testutil.Ok(t, e2e.StartAndWaitReady(q))
Expand Down

0 comments on commit ab93ce0

Please sign in to comment.