diff --git a/pkg/query/endpointset_test.go b/pkg/query/endpointset_test.go index 2edfe01718..70b95c8ab5 100644 --- a/pkg/query/endpointset_test.go +++ b/pkg/query/endpointset_test.go @@ -272,7 +272,7 @@ func (e *testEndpoints) CloseOne(addr string) { } func TestTruncateExtLabels(t *testing.T) { - const testLength = 5 + const testLength = 10 for _, tc := range []struct { labelToTruncate string @@ -283,20 +283,24 @@ func TestTruncateExtLabels(t *testing.T) { expectedOutput: "{abc}", }, { - labelToTruncate: "{abcd}", - expectedOutput: "{abc}", + labelToTruncate: "{abcdefgh}", + expectedOutput: "{abcdefgh}", }, { - labelToTruncate: "{abcde}", - expectedOutput: "{abc}", + labelToTruncate: "{abcdefghij}", + expectedOutput: "{abcdefgh}", }, { - labelToTruncate: "{abcdef}", - expectedOutput: "{abc}", + labelToTruncate: "{abcde花}", + expectedOutput: "{abcde花}", }, { - labelToTruncate: "{abcdefghij}", - expectedOutput: "{abc}", + labelToTruncate: "{abcde花朵}", + expectedOutput: "{abcde花}", + }, + { + labelToTruncate: "{abcde花fghij}", + expectedOutput: "{abcde花}", }, } { t.Run(tc.labelToTruncate, func(t *testing.T) {