@@ -1342,7 +1342,8 @@ func TestGetRules(t *testing.T) {
1342
1342
1343
1343
// Sync Rules
1344
1344
forEachRuler (func (_ string , r * Ruler ) {
1345
- r .syncRules (context .Background (), rulerSyncReasonInitial )
1345
+ err := r .syncRules (context .Background (), rulerSyncReasonInitial )
1346
+ require .NoError (t , err )
1346
1347
})
1347
1348
1348
1349
if tc .sharding {
@@ -1572,7 +1573,8 @@ func TestGetRulesFromBackup(t *testing.T) {
1572
1573
1573
1574
// Sync Rules
1574
1575
forEachRuler (func (_ string , r * Ruler ) {
1575
- r .syncRules (context .Background (), rulerSyncReasonInitial )
1576
+ err := r .syncRules (context .Background (), rulerSyncReasonInitial )
1577
+ require .NoError (t , err )
1576
1578
})
1577
1579
1578
1580
// update the State of the rulers in the ring based on tc.rulerStateMap
@@ -1788,7 +1790,8 @@ func getRulesHATest(replicationFactor int) func(t *testing.T) {
1788
1790
1789
1791
// Sync Rules
1790
1792
forEachRuler (func (_ string , r * Ruler ) {
1791
- r .syncRules (context .Background (), rulerSyncReasonInitial )
1793
+ err := r .syncRules (context .Background (), rulerSyncReasonInitial )
1794
+ require .NoError (t , err )
1792
1795
})
1793
1796
1794
1797
// update the State of the rulers in the ring based on tc.rulerStateMap
@@ -1811,8 +1814,10 @@ func getRulesHATest(replicationFactor int) func(t *testing.T) {
1811
1814
t .Errorf ("ruler %s was not terminated with error %s" , "ruler1" , err .Error ())
1812
1815
}
1813
1816
1814
- rulerAddrMap ["ruler2" ].syncRules (context .Background (), rulerSyncReasonPeriodic )
1815
- rulerAddrMap ["ruler3" ].syncRules (context .Background (), rulerSyncReasonPeriodic )
1817
+ err = rulerAddrMap ["ruler2" ].syncRules (context .Background (), rulerSyncReasonPeriodic )
1818
+ require .NoError (t , err )
1819
+ err = rulerAddrMap ["ruler3" ].syncRules (context .Background (), rulerSyncReasonPeriodic )
1820
+ require .NoError (t , err )
1816
1821
1817
1822
requireGroupStateEqual := func (a * GroupStateDesc , b * GroupStateDesc ) {
1818
1823
require .Equal (t , a .Group .Interval , b .Group .Interval )
@@ -2800,7 +2805,8 @@ func TestRecoverAlertsPostOutage(t *testing.T) {
2800
2805
evalFunc := func (ctx context.Context , g * promRules.Group , evalTimestamp time.Time ) {}
2801
2806
2802
2807
r , _ := buildRulerWithIterFunc (t , rulerCfg , & querier.TestConfig {Cfg : querierConfig , Distributor : d , Stores : queryables }, store , nil , evalFunc )
2803
- r .syncRules (context .Background (), rulerSyncReasonInitial )
2808
+ err := r .syncRules (context .Background (), rulerSyncReasonInitial )
2809
+ require .NoError (t , err )
2804
2810
2805
2811
// assert initial state of rule group
2806
2812
ruleGroup := r .manager .GetRules ("user1" )[0 ]
@@ -3265,7 +3271,8 @@ func TestGetShardSizeForUser(t *testing.T) {
3265
3271
3266
3272
// Sync Rules
3267
3273
forEachRuler (func (_ string , r * Ruler ) {
3268
- r .syncRules (context .Background (), rulerSyncReasonInitial )
3274
+ err := r .syncRules (context .Background (), rulerSyncReasonInitial )
3275
+ require .NoError (t , err )
3269
3276
})
3270
3277
3271
3278
result := testRuler .getShardSizeForUser (tc .userID )
0 commit comments