diff --git a/model/textparse/openmetricsparse_test.go b/model/textparse/openmetricsparse_test.go index 2ad26a616..33622bf09 100644 --- a/model/textparse/openmetricsparse_test.go +++ b/model/textparse/openmetricsparse_test.go @@ -301,9 +301,10 @@ foo_total 17.0 1520879607.789 # {id="counter-test"} 5` } func TestUTF8OpenMetricsParse(t *testing.T) { + oldValidationScheme := model.NameValidationScheme model.NameValidationScheme = model.UTF8Validation defer func() { - model.NameValidationScheme = model.LegacyValidation + model.NameValidationScheme = oldValidationScheme }() input := `# HELP "go.gc_duration_seconds" A summary of the GC invocation durations. diff --git a/model/textparse/promparse_test.go b/model/textparse/promparse_test.go index 504500daa..bb7d9c538 100644 --- a/model/textparse/promparse_test.go +++ b/model/textparse/promparse_test.go @@ -219,9 +219,10 @@ testmetric{label="\"bar\""} 1` } func TestUTF8PromParse(t *testing.T) { + oldValidationScheme := model.NameValidationScheme model.NameValidationScheme = model.UTF8Validation defer func() { - model.NameValidationScheme = model.LegacyValidation + model.NameValidationScheme = oldValidationScheme }() input := `# HELP "go.gc_duration_seconds" A summary of the GC invocation durations.