@@ -1274,12 +1274,12 @@ func TestSentinelClientPubSub(t *testing.T) {
1274
1274
// switch to false master
1275
1275
messages <- PubSubMessage {Channel : "+switch-master" , Message : "test 1 2" }
1276
1276
1277
- for atomic .LoadInt32 (& m2close ) != 2 {
1277
+ for atomic .LoadInt32 (& m2close ) < 2 {
1278
1278
t .Log ("wait false m2 to be close" , atomic .LoadInt32 (& m2close ))
1279
1279
time .Sleep (time .Millisecond * 100 )
1280
1280
}
1281
1281
1282
- for atomic .LoadInt32 (& s0count ) != 3 {
1282
+ for atomic .LoadInt32 (& s0count ) < 3 {
1283
1283
t .Log ("wait s0 to be call third time" , atomic .LoadInt32 (& s0count ))
1284
1284
time .Sleep (time .Millisecond * 100 )
1285
1285
}
@@ -1292,7 +1292,7 @@ func TestSentinelClientPubSub(t *testing.T) {
1292
1292
// switch to master by reboot
1293
1293
messages <- PubSubMessage {Channel : "+reboot" , Message : "master test 4" }
1294
1294
1295
- for atomic .LoadInt32 (& m1close ) != 1 {
1295
+ for atomic .LoadInt32 (& m1close ) < 1 {
1296
1296
t .Log ("wait old m1 to be close" , atomic .LoadInt32 (& m1close ))
1297
1297
time .Sleep (time .Millisecond * 100 )
1298
1298
}
@@ -1305,11 +1305,11 @@ func TestSentinelClientPubSub(t *testing.T) {
1305
1305
close (messages )
1306
1306
client .Close ()
1307
1307
1308
- for atomic .LoadInt32 (& s0close ) != 4 {
1308
+ for atomic .LoadInt32 (& s0close ) < 4 {
1309
1309
t .Log ("wait old s0 to be close" , atomic .LoadInt32 (& s0close ))
1310
1310
time .Sleep (time .Millisecond * 100 )
1311
1311
}
1312
- for atomic .LoadInt32 (& m4close ) != 1 {
1312
+ for atomic .LoadInt32 (& m4close ) < 1 {
1313
1313
t .Log ("wait old m1 to be close" , atomic .LoadInt32 (& m4close ))
1314
1314
time .Sleep (time .Millisecond * 100 )
1315
1315
}
@@ -1461,17 +1461,17 @@ func TestSentinelReplicaOnlyClientPubSub(t *testing.T) {
1461
1461
// it will cause s0 to return :2 in DoMulti response
1462
1462
messages <- PubSubMessage {Channel : "+slave" , Message : "slave 0:0 0 2 @ replicaonly 0 0" }
1463
1463
1464
- for atomic .LoadInt32 (& slave2close ) != 1 {
1464
+ for atomic .LoadInt32 (& slave2close ) < 1 {
1465
1465
t .Log ("wait false slave2 to be close" , atomic .LoadInt32 (& slave2close ))
1466
1466
time .Sleep (time .Millisecond * 100 )
1467
1467
}
1468
1468
1469
- for atomic .LoadInt32 (& s0count ) != 3 {
1469
+ for atomic .LoadInt32 (& s0count ) < 3 {
1470
1470
t .Log ("wait s0 to be call third time" , atomic .LoadInt32 (& s0count ))
1471
1471
time .Sleep (time .Millisecond * 100 )
1472
1472
}
1473
1473
1474
- for atomic .LoadInt32 (& slave1close ) != 1 {
1474
+ for atomic .LoadInt32 (& slave1close ) < 1 {
1475
1475
t .Log ("wait for slave1 to close (and for client to use slave4)" , atomic .LoadInt32 (& slave1close ))
1476
1476
time .Sleep (time .Millisecond * 100 )
1477
1477
}
@@ -1484,7 +1484,7 @@ func TestSentinelReplicaOnlyClientPubSub(t *testing.T) {
1484
1484
// switch to new slave by reboot
1485
1485
messages <- PubSubMessage {Channel : "+reboot" , Message : "slave 0:0 0 1 @ replicaonly 0 0" }
1486
1486
1487
- for atomic .LoadInt32 (& slave4close ) != 1 {
1487
+ for atomic .LoadInt32 (& slave4close ) < 1 {
1488
1488
t .Log ("wait old slave4 to be close" , atomic .LoadInt32 (& slave4close ))
1489
1489
time .Sleep (time .Millisecond * 100 )
1490
1490
}
@@ -1497,11 +1497,11 @@ func TestSentinelReplicaOnlyClientPubSub(t *testing.T) {
1497
1497
close (messages )
1498
1498
client .Close ()
1499
1499
1500
- for atomic .LoadInt32 (& s0close ) != 4 {
1500
+ for atomic .LoadInt32 (& s0close ) < 4 {
1501
1501
t .Log ("wait old s0 to be close" , atomic .LoadInt32 (& s0close ))
1502
1502
time .Sleep (time .Millisecond * 100 )
1503
1503
}
1504
- for atomic .LoadInt32 (& slave1close ) != 2 {
1504
+ for atomic .LoadInt32 (& slave1close ) < 2 {
1505
1505
t .Log ("wait old slave1 to be close" , atomic .LoadInt32 (& slave1close ))
1506
1506
time .Sleep (time .Millisecond * 100 )
1507
1507
}
0 commit comments