Skip to content

Commit

Permalink
Fix failing tests
Browse files Browse the repository at this point in the history
- TestCardinalityQueryRequestValidationRoundTripper revert `model.NameValidationScheme` to `LegacyValidation`
- `TestStreamingChunkSeries_CreateIteratorTwice`: Quote label name in error message
  • Loading branch information
julienduchesne committed Dec 16, 2024
1 parent b1f6192 commit 8c7f184
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions pkg/frontend/querymiddleware/request_validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,14 @@ import (
"net/http"

"github.com/grafana/dskit/cancellation"
"github.com/prometheus/common/model"
)

func init() {
// Mimir doesn't support Prometheus' UTF-8 metric/label name scheme yet.
model.NameValidationScheme = model.LegacyValidation
}

const requestValidationFailedFmt = "request validation failed for "

var errMetricsQueryRequestValidationFailed = cancellation.NewErrorf(
Expand Down
2 changes: 1 addition & 1 deletion pkg/querier/distributor_queryable_streaming_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func TestStreamingChunkSeries_CreateIteratorTwice(t *testing.T) {

iterator = series.Iterator(iterator)
require.NotNil(t, iterator)
require.EqualError(t, iterator.Err(), `can't create iterator multiple times for the one streaming series ({the-name="the-value"})`)
require.EqualError(t, iterator.Err(), `can't create iterator multiple times for the one streaming series ({"the-name"="the-value"})`)
}

func createTestChunk(t *testing.T, time int64, value float64) client.Chunk {
Expand Down

0 comments on commit 8c7f184

Please sign in to comment.