7
7
8
8
"github.com/stretchr/testify/require"
9
9
10
+ "github.com/grafana/loki/v3/pkg/limits"
10
11
"github.com/grafana/loki/v3/pkg/logproto"
11
12
)
12
13
@@ -40,14 +41,14 @@ func TestFrontend_ExceedsLimits(t *testing.T) {
40
41
Tenant : "test" ,
41
42
Results : []* logproto.ExceedsLimitsResult {{
42
43
StreamHash : 0x1 ,
43
- Reason : ReasonExceedsMaxStreams ,
44
+ Reason : uint32 ( limits . ReasonExceedsMaxStreams ) ,
44
45
}},
45
46
}},
46
47
expected : & logproto.ExceedsLimitsResponse {
47
48
Tenant : "test" ,
48
49
Results : []* logproto.ExceedsLimitsResult {{
49
50
StreamHash : 0x1 ,
50
- Reason : ReasonExceedsMaxStreams ,
51
+ Reason : uint32 ( limits . ReasonExceedsMaxStreams ) ,
51
52
}},
52
53
},
53
54
}, {
@@ -86,20 +87,20 @@ func TestFrontend_ExceedsLimits(t *testing.T) {
86
87
Tenant : "test" ,
87
88
Results : []* logproto.ExceedsLimitsResult {{
88
89
StreamHash : 0x1 ,
89
- Reason : ReasonExceedsMaxStreams ,
90
+ Reason : uint32 ( limits . ReasonExceedsMaxStreams ) ,
90
91
}, {
91
92
StreamHash : 0x4 ,
92
- Reason : ReasonExceedsRateLimit ,
93
+ Reason : uint32 ( limits . ReasonExceedsRateLimit ) ,
93
94
}},
94
95
}},
95
96
expected : & logproto.ExceedsLimitsResponse {
96
97
Tenant : "test" ,
97
98
Results : []* logproto.ExceedsLimitsResult {{
98
99
StreamHash : 0x1 ,
99
- Reason : ReasonExceedsMaxStreams ,
100
+ Reason : uint32 ( limits . ReasonExceedsMaxStreams ) ,
100
101
}, {
101
102
StreamHash : 0x4 ,
102
- Reason : ReasonExceedsRateLimit ,
103
+ Reason : uint32 ( limits . ReasonExceedsRateLimit ) ,
103
104
}},
104
105
},
105
106
}, {
@@ -120,23 +121,23 @@ func TestFrontend_ExceedsLimits(t *testing.T) {
120
121
Tenant : "test" ,
121
122
Results : []* logproto.ExceedsLimitsResult {{
122
123
StreamHash : 0x1 ,
123
- Reason : ReasonExceedsMaxStreams ,
124
+ Reason : uint32 ( limits . ReasonExceedsMaxStreams ) ,
124
125
}},
125
126
}, {
126
127
Tenant : "test" ,
127
128
Results : []* logproto.ExceedsLimitsResult {{
128
129
StreamHash : 0x4 ,
129
- Reason : ReasonExceedsRateLimit ,
130
+ Reason : uint32 ( limits . ReasonExceedsRateLimit ) ,
130
131
}},
131
132
}},
132
133
expected : & logproto.ExceedsLimitsResponse {
133
134
Tenant : "test" ,
134
135
Results : []* logproto.ExceedsLimitsResult {{
135
136
StreamHash : 0x1 ,
136
- Reason : ReasonExceedsMaxStreams ,
137
+ Reason : uint32 ( limits . ReasonExceedsMaxStreams ) ,
137
138
}, {
138
139
StreamHash : 0x4 ,
139
- Reason : ReasonExceedsRateLimit ,
140
+ Reason : uint32 ( limits . ReasonExceedsRateLimit ) ,
140
141
}},
141
142
},
142
143
}}
0 commit comments