@@ -1316,7 +1316,7 @@ func TestIngester_Push(t *testing.T) {
1316
1316
},
1317
1317
cortexpb .API ),
1318
1318
},
1319
- expectedErr : httpgrpc .Errorf (http .StatusBadRequest , wrapWithUser (wrappedTSDBIngestErr (storage .ErrOutOfOrderSample , model .Time (9 ), cortexpb .FromLabelsToLabelAdapters (metricLabels )), userID ).Error ()),
1319
+ expectedErr : httpgrpc .Errorf (http .StatusBadRequest , "%s" , wrapWithUser (wrappedTSDBIngestErr (storage .ErrOutOfOrderSample , model .Time (9 ), cortexpb .FromLabelsToLabelAdapters (metricLabels )), userID ).Error ()),
1320
1320
expectedIngested : []cortexpb.TimeSeries {
1321
1321
{Labels : metricLabelAdapters , Samples : []cortexpb.Sample {{Value : 2 , TimestampMs : 10 }}},
1322
1322
},
@@ -1384,7 +1384,7 @@ func TestIngester_Push(t *testing.T) {
1384
1384
},
1385
1385
cortexpb .API ),
1386
1386
},
1387
- expectedErr : httpgrpc .Errorf (http .StatusBadRequest , wrapWithUser (wrappedTSDBIngestErr (storage .ErrOutOfBounds , model .Time (1575043969 - (86400 * 1000 )), cortexpb .FromLabelsToLabelAdapters (metricLabels )), userID ).Error ()),
1387
+ expectedErr : httpgrpc .Errorf (http .StatusBadRequest , "%s" , wrapWithUser (wrappedTSDBIngestErr (storage .ErrOutOfBounds , model .Time (1575043969 - (86400 * 1000 )), cortexpb .FromLabelsToLabelAdapters (metricLabels )), userID ).Error ()),
1388
1388
expectedIngested : []cortexpb.TimeSeries {
1389
1389
{Labels : metricLabelAdapters , Samples : []cortexpb.Sample {{Value : 2 , TimestampMs : 1575043969 }}},
1390
1390
},
@@ -1438,7 +1438,7 @@ func TestIngester_Push(t *testing.T) {
1438
1438
cortexpb .API ),
1439
1439
},
1440
1440
oooTimeWindow : 5 * time .Minute ,
1441
- expectedErr : httpgrpc .Errorf (http .StatusBadRequest , wrapWithUser (wrappedTSDBIngestErr (storage .ErrTooOldSample , model .Time (1575043969 - (600 * 1000 )), cortexpb .FromLabelsToLabelAdapters (metricLabels )), userID ).Error ()),
1441
+ expectedErr : httpgrpc .Errorf (http .StatusBadRequest , "%s" , wrapWithUser (wrappedTSDBIngestErr (storage .ErrTooOldSample , model .Time (1575043969 - (600 * 1000 )), cortexpb .FromLabelsToLabelAdapters (metricLabels )), userID ).Error ()),
1442
1442
expectedIngested : []cortexpb.TimeSeries {
1443
1443
{Labels : metricLabelAdapters , Samples : []cortexpb.Sample {{Value : 2 , TimestampMs : 1575043969 }}},
1444
1444
},
@@ -1534,7 +1534,7 @@ func TestIngester_Push(t *testing.T) {
1534
1534
},
1535
1535
oooTimeWindow : 5 * time .Minute ,
1536
1536
enableOOONativeHistograms : false ,
1537
- expectedErr : httpgrpc .Errorf (http .StatusBadRequest , wrapWithUser (wrappedTSDBIngestErr (storage .ErrOOONativeHistogramsDisabled , model .Time (1575043969 - (10 )), cortexpb .FromLabelsToLabelAdapters (metricLabels )), userID ).Error ()),
1537
+ expectedErr : httpgrpc .Errorf (http .StatusBadRequest , "%s" , wrapWithUser (wrappedTSDBIngestErr (storage .ErrOOONativeHistogramsDisabled , model .Time (1575043969 - (10 )), cortexpb .FromLabelsToLabelAdapters (metricLabels )), userID ).Error ()),
1538
1538
expectedIngested : []cortexpb.TimeSeries {
1539
1539
{Labels : metricLabelAdapters , Histograms : []cortexpb.Histogram {cortexpb .HistogramToHistogramProto (1575043969 , tsdbutil .GenerateTestHistogram (1 ))}},
1540
1540
},
@@ -1593,7 +1593,7 @@ func TestIngester_Push(t *testing.T) {
1593
1593
},
1594
1594
oooTimeWindow : 5 * time .Minute ,
1595
1595
enableOOONativeHistograms : true ,
1596
- expectedErr : httpgrpc .Errorf (http .StatusBadRequest , wrapWithUser (wrappedTSDBIngestErr (storage .ErrTooOldSample , model .Time (1575043969 - (600 * 1000 )), cortexpb .FromLabelsToLabelAdapters (metricLabels )), userID ).Error ()),
1596
+ expectedErr : httpgrpc .Errorf (http .StatusBadRequest , "%s" , wrapWithUser (wrappedTSDBIngestErr (storage .ErrTooOldSample , model .Time (1575043969 - (600 * 1000 )), cortexpb .FromLabelsToLabelAdapters (metricLabels )), userID ).Error ()),
1597
1597
expectedIngested : []cortexpb.TimeSeries {
1598
1598
{Labels : metricLabelAdapters , Histograms : []cortexpb.Histogram {cortexpb .HistogramToHistogramProto (1575043969 , tsdbutil .GenerateTestHistogram (1 ))}},
1599
1599
},
@@ -1712,7 +1712,7 @@ func TestIngester_Push(t *testing.T) {
1712
1712
nil ,
1713
1713
cortexpb .API ),
1714
1714
},
1715
- expectedErr : httpgrpc .Errorf (http .StatusBadRequest , wrapWithUser (wrappedTSDBIngestErr (storage .NewDuplicateFloatErr (1575043969 , 2 , 1 ), model .Time (1575043969 ), cortexpb .FromLabelsToLabelAdapters (metricLabels )), userID ).Error ()),
1715
+ expectedErr : httpgrpc .Errorf (http .StatusBadRequest , "%s" , wrapWithUser (wrappedTSDBIngestErr (storage .NewDuplicateFloatErr (1575043969 , 2 , 1 ), model .Time (1575043969 ), cortexpb .FromLabelsToLabelAdapters (metricLabels )), userID ).Error ()),
1716
1716
expectedIngested : []cortexpb.TimeSeries {
1717
1717
{Labels : metricLabelAdapters , Samples : []cortexpb.Sample {{Value : 2 , TimestampMs : 1575043969 }}},
1718
1718
},
@@ -1766,7 +1766,7 @@ func TestIngester_Push(t *testing.T) {
1766
1766
},
1767
1767
},
1768
1768
},
1769
- expectedErr : httpgrpc .Errorf (http .StatusBadRequest , wrapWithUser (wrappedTSDBIngestExemplarErr (errExemplarRef , model .Time (1000 ), cortexpb .FromLabelsToLabelAdapters (metricLabels ), []cortexpb.LabelAdapter {{Name : "traceID" , Value : "123" }}), userID ).Error ()),
1769
+ expectedErr : httpgrpc .Errorf (http .StatusBadRequest , "%s" , wrapWithUser (wrappedTSDBIngestExemplarErr (errExemplarRef , model .Time (1000 ), cortexpb .FromLabelsToLabelAdapters (metricLabels ), []cortexpb.LabelAdapter {{Name : "traceID" , Value : "123" }}), userID ).Error ()),
1770
1770
expectedIngested : nil ,
1771
1771
expectedMetadataIngested : nil ,
1772
1772
additionalMetrics : []string {
@@ -2260,7 +2260,7 @@ func TestIngester_PushNativeHistogramErrors(t *testing.T) {
2260
2260
req := cortexpb .ToWriteRequest ([]labels.Labels {metricLabels }, nil , nil , tc .histograms , cortexpb .API )
2261
2261
// Push timeseries
2262
2262
_ , err = i .Push (ctx , req )
2263
- assert .Equal (t , httpgrpc .Errorf (http .StatusBadRequest , wrapWithUser (wrappedTSDBIngestErr (tc .expectedErr , model .Time (10 ), metricLabelAdapters ), userID ).Error ()), err )
2263
+ assert .Equal (t , httpgrpc .Errorf (http .StatusBadRequest , "%s" , wrapWithUser (wrappedTSDBIngestErr (tc .expectedErr , model .Time (10 ), metricLabelAdapters ), userID ).Error ()), err )
2264
2264
2265
2265
require .Equal (t , testutil .ToFloat64 (i .metrics .ingestedHistogramsFail ), float64 (1 ))
2266
2266
})
@@ -5557,7 +5557,7 @@ func TestIngesterPushErrorDuringForcedCompaction(t *testing.T) {
5557
5557
req , _ := mockWriteRequest (t , labels.Labels {{Name : labels .MetricName , Value : "test" }}, 0 , util .TimeToMillis (time .Now ()))
5558
5558
ctx := user .InjectOrgID (context .Background (), userID )
5559
5559
_ , err = i .Push (ctx , req )
5560
- require .Equal (t , httpgrpc .Errorf (http .StatusServiceUnavailable , wrapWithUser (errors .New ("forced compaction in progress" ), userID ).Error ()), err )
5560
+ require .Equal (t , httpgrpc .Errorf (http .StatusServiceUnavailable , "%s" , wrapWithUser (errors .New ("forced compaction in progress" ), userID ).Error ()), err )
5561
5561
5562
5562
// Ingestion is successful after a flush.
5563
5563
require .True (t , db .casState (forceCompacting , active ))
0 commit comments