@@ -269,7 +269,7 @@ public void test() throws Exception {
269
269
while (failed .get () == false && System .nanoTime () < endTime ) {
270
270
271
271
// Wait a bit:
272
- sleep (TestUtil .nextInt (random (), Math .min (runTimeSec * 4 , 200 ), runTimeSec * 4 ));
272
+ pause (TestUtil .nextInt (random (), Math .min (runTimeSec * 4 , 200 ), runTimeSec * 4 ));
273
273
if (primary != null && random ().nextBoolean ()) {
274
274
NodeProcess curPrimary = primary ;
275
275
if (curPrimary != null ) {
@@ -672,7 +672,7 @@ NodeProcess startNode(final int id, Path indexPath, boolean isPrimary, long forc
672
672
return null ;
673
673
} else {
674
674
try {
675
- sleep (10 );
675
+ pause (10 );
676
676
} catch (InterruptedException ie ) {
677
677
throw new ThreadInterruptedException (ie );
678
678
}
@@ -722,7 +722,7 @@ NodeProcess startNode(final int id, Path indexPath, boolean isPrimary, long forc
722
722
() -> {
723
723
while (System .nanoTime () < deadline && p .isAlive ()) {
724
724
try {
725
- sleep (250 );
725
+ pause (250 );
726
726
} catch (
727
727
@ SuppressWarnings ("unused" )
728
728
InterruptedException e ) {
@@ -815,7 +815,7 @@ NodeProcess startNode(final int id, Path indexPath, boolean isPrimary, long forc
815
815
}
816
816
817
817
@ SuppressForbidden (reason = "Thread sleep" )
818
- private static void sleep (int millis ) throws InterruptedException {
818
+ private static void pause (int millis ) throws InterruptedException {
819
819
Thread .sleep (millis );
820
820
}
821
821
@@ -909,7 +909,7 @@ public void run() {
909
909
910
910
try {
911
911
while (stop .get () == false ) {
912
- sleep (TestUtil .nextInt (random (), 50 , 500 ));
912
+ pause (TestUtil .nextInt (random (), 50 , 500 ));
913
913
// message("top: restarter cycle");
914
914
915
915
// Randomly crash full cluster:
@@ -919,7 +919,7 @@ public void run() {
919
919
if (starting [i ]) {
920
920
message ("N" + i + ": top: wait for startup so we can crash..." );
921
921
while (starting [i ]) {
922
- sleep (10 );
922
+ pause (10 );
923
923
}
924
924
message ("N" + i + ": top: done wait for startup" );
925
925
}
@@ -1015,7 +1015,7 @@ public void run() {
1015
1015
message ("Restarter: now stop: join " + startupThreads .size () + " startup threads" );
1016
1016
1017
1017
while (!startupThreads .isEmpty ()) {
1018
- sleep (1000 );
1018
+ pause (1000 );
1019
1019
message ("Waiting for startup threads to terminate." );
1020
1020
}
1021
1021
} catch (Throwable t ) {
@@ -1077,7 +1077,7 @@ public void run() {
1077
1077
if (node .isOpen == false ) {
1078
1078
throw new IOException ("node closed" );
1079
1079
}
1080
- sleep (1 );
1080
+ pause (1 );
1081
1081
}
1082
1082
version = c .in .readVLong ();
1083
1083
@@ -1088,7 +1088,7 @@ public void run() {
1088
1088
if (node .isOpen == false ) {
1089
1089
throw new IOException ("node closed" );
1090
1090
}
1091
- sleep (1 );
1091
+ pause (1 );
1092
1092
}
1093
1093
int hitCount = c .in .readVInt ();
1094
1094
@@ -1164,7 +1164,7 @@ && random().nextInt(10) == 7) {
1164
1164
if (node .isOpen == false ) {
1165
1165
throw new IOException ("node died" );
1166
1166
}
1167
- sleep (1 );
1167
+ pause (1 );
1168
1168
}
1169
1169
1170
1170
version = c .in .readVLong ();
@@ -1176,7 +1176,7 @@ && random().nextInt(10) == 7) {
1176
1176
if (node .isOpen == false ) {
1177
1177
throw new IOException ("node died" );
1178
1178
}
1179
- sleep (1 );
1179
+ pause (1 );
1180
1180
}
1181
1181
1182
1182
int hitCount = c .in .readVInt ();
@@ -1211,7 +1211,7 @@ && random().nextInt(10) == 7) {
1211
1211
}
1212
1212
}
1213
1213
1214
- sleep (10 );
1214
+ pause (10 );
1215
1215
1216
1216
} catch (Throwable t ) {
1217
1217
failed .set (true );
@@ -1250,7 +1250,7 @@ public void run() {
1250
1250
1251
1251
try {
1252
1252
while (stop .get () == false && curPrimary == null ) {
1253
- sleep (10 );
1253
+ pause (10 );
1254
1254
curPrimary = primary ;
1255
1255
if (curPrimary != null ) {
1256
1256
c = new Connection (curPrimary .tcpPort );
@@ -1320,13 +1320,13 @@ public void run() {
1320
1320
}
1321
1321
1322
1322
if (random ().nextInt (sleepChance ) == 0 ) {
1323
- sleep (10 );
1323
+ pause (10 );
1324
1324
}
1325
1325
1326
1326
if (random ().nextInt (100 ) == 17 ) {
1327
1327
int pauseMS = TestUtil .nextInt (random (), 500 , 2000 );
1328
1328
message ("Indexer: now pause for " + pauseMS + " ms..." );
1329
- sleep (pauseMS );
1329
+ pause (pauseMS );
1330
1330
message ("Indexer: done pause for a bit..." );
1331
1331
}
1332
1332
}
0 commit comments