@@ -112,8 +112,8 @@ func TestFrontend_ExceedsLimits(t *testing.T) {
112
112
maxGlobalStreams : 5 ,
113
113
ingestionRate : 100 ,
114
114
expected : []* logproto.ExceedsLimitsResult {
115
- {StreamHash : 0x1 , Reason : limits .ReasonExceedsMaxStreams },
116
- {StreamHash : 0x2 , Reason : limits .ReasonExceedsMaxStreams },
115
+ {StreamHash : 0x1 , Reason : limits .ReasonExceedsMaxStreams . Humanize () },
116
+ {StreamHash : 0x2 , Reason : limits .ReasonExceedsMaxStreams . Humanize () },
117
117
},
118
118
}, {
119
119
name : "exceeds max streams limit, allows existing streams and returns the new streams" ,
@@ -148,8 +148,8 @@ func TestFrontend_ExceedsLimits(t *testing.T) {
148
148
maxGlobalStreams : 5 ,
149
149
ingestionRate : 100 ,
150
150
expected : []* logproto.ExceedsLimitsResult {
151
- {StreamHash : 6 , Reason : limits .ReasonExceedsMaxStreams },
152
- {StreamHash : 7 , Reason : limits .ReasonExceedsMaxStreams },
151
+ {StreamHash : 6 , Reason : limits .ReasonExceedsMaxStreams . Humanize () },
152
+ {StreamHash : 7 , Reason : limits .ReasonExceedsMaxStreams . Humanize () },
153
153
},
154
154
}, {
155
155
// This test checks the case where a tenant's streams are sharded over
@@ -202,7 +202,7 @@ func TestFrontend_ExceedsLimits(t *testing.T) {
202
202
maxGlobalStreams : 1 ,
203
203
ingestionRate : 100 ,
204
204
expected : []* logproto.ExceedsLimitsResult {
205
- {StreamHash : 0x1 , Reason : limits .ReasonExceedsMaxStreams },
205
+ {StreamHash : 0x1 , Reason : limits .ReasonExceedsMaxStreams . Humanize () },
206
206
},
207
207
}, {
208
208
name : "exceeds rate limits, returns all streams" ,
@@ -231,8 +231,8 @@ func TestFrontend_ExceedsLimits(t *testing.T) {
231
231
maxGlobalStreams : 10 ,
232
232
ingestionRate : 100 ,
233
233
expected : []* logproto.ExceedsLimitsResult {
234
- {StreamHash : 1 , Reason : limits .ReasonExceedsRateLimit },
235
- {StreamHash : 2 , Reason : limits .ReasonExceedsRateLimit },
234
+ {StreamHash : 1 , Reason : limits .ReasonExceedsRateLimit . Humanize () },
235
+ {StreamHash : 2 , Reason : limits .ReasonExceedsRateLimit . Humanize () },
236
236
},
237
237
}, {
238
238
name : "exceeds rate limits, rates sharded over two instances" ,
@@ -274,8 +274,8 @@ func TestFrontend_ExceedsLimits(t *testing.T) {
274
274
maxGlobalStreams : 10 ,
275
275
ingestionRate : 100 ,
276
276
expected : []* logproto.ExceedsLimitsResult {
277
- {StreamHash : 1 , Reason : limits .ReasonExceedsRateLimit },
278
- {StreamHash : 2 , Reason : limits .ReasonExceedsRateLimit },
277
+ {StreamHash : 1 , Reason : limits .ReasonExceedsRateLimit . Humanize () },
278
+ {StreamHash : 2 , Reason : limits .ReasonExceedsRateLimit . Humanize () },
279
279
},
280
280
}, {
281
281
name : "exceeds both max stream limit and rate limits" ,
@@ -305,10 +305,10 @@ func TestFrontend_ExceedsLimits(t *testing.T) {
305
305
maxGlobalStreams : 5 ,
306
306
ingestionRate : 100 ,
307
307
expected : []* logproto.ExceedsLimitsResult {
308
- {StreamHash : 0x6 , Reason : limits .ReasonExceedsMaxStreams },
309
- {StreamHash : 0x7 , Reason : limits .ReasonExceedsMaxStreams },
310
- {StreamHash : 0x6 , Reason : limits .ReasonExceedsRateLimit },
311
- {StreamHash : 0x7 , Reason : limits .ReasonExceedsRateLimit },
308
+ {StreamHash : 0x6 , Reason : limits .ReasonExceedsMaxStreams . Humanize () },
309
+ {StreamHash : 0x7 , Reason : limits .ReasonExceedsMaxStreams . Humanize () },
310
+ {StreamHash : 0x6 , Reason : limits .ReasonExceedsRateLimit . Humanize () },
311
+ {StreamHash : 0x7 , Reason : limits .ReasonExceedsRateLimit . Humanize () },
312
312
},
313
313
}}
314
314
0 commit comments