Skip to content

Commit 316b7ea

Browse files
committed
Merge pull request #1170 from mattrjacobs/cleanup-stream-tests
Cleanup stream tests
2 parents ae71d96 + 6fde60f commit 316b7ea

11 files changed

+114
-113
lines changed

hystrix-core/src/test/java/com/netflix/hystrix/metric/consumer/CumulativeCollapserEventCounterStreamTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public void testEmptyStreamProducesZeros() {
9090
//no writes
9191

9292
try {
93-
latch.await(10000, TimeUnit.MILLISECONDS);
93+
assertTrue(latch.await(10000, TimeUnit.MILLISECONDS));
9494
} catch (InterruptedException ex) {
9595
fail("Interrupted ex");
9696
}
@@ -116,7 +116,7 @@ public void testCollapsed() {
116116
}
117117

118118
try {
119-
latch.await(10000, TimeUnit.MILLISECONDS);
119+
assertTrue(latch.await(10000, TimeUnit.MILLISECONDS));
120120
} catch (InterruptedException ex) {
121121
fail("Interrupted ex");
122122
}
@@ -144,7 +144,7 @@ public void testCollapsedAndResponseFromCache() {
144144
}
145145

146146
try {
147-
latch.await(10000, TimeUnit.MILLISECONDS);
147+
assertTrue(latch.await(10000, TimeUnit.MILLISECONDS));
148148
} catch (InterruptedException ex) {
149149
fail("Interrupted ex");
150150
}
@@ -174,7 +174,7 @@ public void testCollapsedAndResponseFromCacheAgeOutOfCumulativeWindow() {
174174
}
175175

176176
try {
177-
latch.await(10000, TimeUnit.MILLISECONDS);
177+
assertTrue(latch.await(10000, TimeUnit.MILLISECONDS));
178178
} catch (InterruptedException ex) {
179179
fail("Interrupted ex");
180180
}

hystrix-core/src/test/java/com/netflix/hystrix/metric/consumer/CumulativeCommandEventCounterStreamTest.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public void testEmptyStreamProducesZeros() {
8585
//no writes
8686

8787
try {
88-
latch.await(10000, TimeUnit.MILLISECONDS);
88+
assertTrue(latch.await(10000, TimeUnit.MILLISECONDS));
8989
} catch (InterruptedException ex) {
9090
fail("Interrupted ex");
9191
}
@@ -107,7 +107,7 @@ public void testSingleSuccess() {
107107
cmd.observe();
108108

109109
try {
110-
latch.await(10000, TimeUnit.MILLISECONDS);
110+
assertTrue(latch.await(10000, TimeUnit.MILLISECONDS));
111111
} catch (InterruptedException ex) {
112112
fail("Interrupted ex");
113113
}
@@ -131,7 +131,7 @@ public void testSingleFailure() {
131131
cmd.observe();
132132

133133
try {
134-
latch.await(10000, TimeUnit.MILLISECONDS);
134+
assertTrue(latch.await(10000, TimeUnit.MILLISECONDS));
135135
} catch (InterruptedException ex) {
136136
fail("Interrupted ex");
137137
}
@@ -156,7 +156,7 @@ public void testSingleTimeout() {
156156
cmd.observe();
157157

158158
try {
159-
latch.await(10000, TimeUnit.MILLISECONDS);
159+
assertTrue(latch.await(10000, TimeUnit.MILLISECONDS));
160160
} catch (InterruptedException ex) {
161161
fail("Interrupted ex");
162162
}
@@ -181,7 +181,7 @@ public void testSingleBadRequest() {
181181
cmd.observe();
182182

183183
try {
184-
latch.await(10000, TimeUnit.MILLISECONDS);
184+
assertTrue(latch.await(10000, TimeUnit.MILLISECONDS));
185185
} catch (InterruptedException ex) {
186186
fail("Interrupted ex");
187187
}
@@ -210,7 +210,7 @@ public void testRequestFromCache() {
210210
cmd3.observe();
211211

212212
try {
213-
latch.await(10000, TimeUnit.MILLISECONDS);
213+
assertTrue(latch.await(10000, TimeUnit.MILLISECONDS));
214214
} catch (InterruptedException ex) {
215215
fail("Interrupted ex");
216216
}
@@ -256,7 +256,7 @@ public void testShortCircuited() {
256256
shortCircuit2.observe();
257257

258258
try {
259-
latch.await(10000, TimeUnit.MILLISECONDS);
259+
assertTrue(latch.await(10000, TimeUnit.MILLISECONDS));
260260
} catch (InterruptedException ex) {
261261
fail("Interrupted ex");
262262
}
@@ -313,7 +313,7 @@ public void run() {
313313
rejected2.observe();
314314

315315
try {
316-
latch.await(10000, TimeUnit.MILLISECONDS);
316+
assertTrue(latch.await(10000, TimeUnit.MILLISECONDS));
317317
} catch (InterruptedException ex) {
318318
fail("Interrupted ex");
319319
}
@@ -365,7 +365,7 @@ public void testThreadPoolRejected() {
365365
rejected2.observe();
366366

367367
try {
368-
latch.await(10000, TimeUnit.MILLISECONDS);
368+
assertTrue(latch.await(10000, TimeUnit.MILLISECONDS));
369369
} catch (InterruptedException ex) {
370370
fail("Interrupted ex");
371371
}
@@ -395,7 +395,7 @@ public void testFallbackFailure() {
395395
cmd.observe();
396396

397397
try {
398-
latch.await(10000, TimeUnit.MILLISECONDS);
398+
assertTrue(latch.await(10000, TimeUnit.MILLISECONDS));
399399
} catch (InterruptedException ex) {
400400
fail("Interrupted ex");
401401
}
@@ -421,7 +421,7 @@ public void testFallbackMissing() {
421421
cmd.observe();
422422

423423
try {
424-
latch.await(10000, TimeUnit.MILLISECONDS);
424+
assertTrue(latch.await(10000, TimeUnit.MILLISECONDS));
425425
} catch (InterruptedException ex) {
426426
fail("Interrupted ex");
427427
}
@@ -467,7 +467,7 @@ public void testFallbackRejection() {
467467
rejection2.observe();
468468

469469
try {
470-
latch.await(10000, TimeUnit.MILLISECONDS);
470+
assertTrue(latch.await(10000, TimeUnit.MILLISECONDS));
471471
} catch (InterruptedException ex) {
472472
fail("Interrupted ex");
473473
}
@@ -494,7 +494,7 @@ public void testCollapsed() {
494494
}
495495

496496
try {
497-
latch.await(10000, TimeUnit.MILLISECONDS);
497+
assertTrue(latch.await(10000, TimeUnit.MILLISECONDS));
498498
} catch (InterruptedException ex) {
499499
fail("Interrupted ex");
500500
}
@@ -524,7 +524,7 @@ public void testMultipleEventsOverTimeGetStoredAndNeverAgeOut() {
524524
cmd2.observe();
525525

526526
try {
527-
latch.await(10000, TimeUnit.MILLISECONDS);
527+
assertTrue(latch.await(10000, TimeUnit.MILLISECONDS));
528528
} catch (InterruptedException ex) {
529529
fail("Interrupted ex");
530530
}

hystrix-core/src/test/java/com/netflix/hystrix/metric/consumer/CumulativeThreadPoolEventCounterStreamTest.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public void testEmptyStreamProducesZeros() {
8686
//no writes
8787

8888
try {
89-
latch.await(10000, TimeUnit.MILLISECONDS);
89+
assertTrue(latch.await(10000, TimeUnit.MILLISECONDS));
9090
} catch (InterruptedException ex) {
9191
fail("Interrupted ex");
9292
}
@@ -111,7 +111,7 @@ public void testSingleSuccess() {
111111
cmd.observe();
112112

113113
try {
114-
latch.await(10000, TimeUnit.MILLISECONDS);
114+
assertTrue(latch.await(10000, TimeUnit.MILLISECONDS));
115115
} catch (InterruptedException ex) {
116116
fail("Interrupted ex");
117117
}
@@ -136,7 +136,7 @@ public void testSingleFailure() {
136136
cmd.observe();
137137

138138
try {
139-
latch.await(10000, TimeUnit.MILLISECONDS);
139+
assertTrue(latch.await(10000, TimeUnit.MILLISECONDS));
140140
} catch (InterruptedException ex) {
141141
fail("Interrupted ex");
142142
}
@@ -161,7 +161,7 @@ public void testSingleTimeout() {
161161
cmd.observe();
162162

163163
try {
164-
latch.await(10000, TimeUnit.MILLISECONDS);
164+
assertTrue(latch.await(10000, TimeUnit.MILLISECONDS));
165165
} catch (InterruptedException ex) {
166166
fail("Interrupted ex");
167167
}
@@ -186,7 +186,7 @@ public void testSingleBadRequest() {
186186
cmd.observe();
187187

188188
try {
189-
latch.await(10000, TimeUnit.MILLISECONDS);
189+
assertTrue(latch.await(10000, TimeUnit.MILLISECONDS));
190190
} catch (InterruptedException ex) {
191191
fail("Interrupted ex");
192192
}
@@ -215,7 +215,7 @@ public void testRequestFromCache() {
215215
cmd3.observe();
216216

217217
try {
218-
latch.await(10000, TimeUnit.MILLISECONDS);
218+
assertTrue(latch.await(10000, TimeUnit.MILLISECONDS));
219219
} catch (InterruptedException ex) {
220220
fail("Interrupted ex");
221221
}
@@ -263,7 +263,7 @@ public void testShortCircuited() {
263263
shortCircuit2.observe();
264264

265265
try {
266-
latch.await(10000, TimeUnit.MILLISECONDS);
266+
assertTrue(latch.await(10000, TimeUnit.MILLISECONDS));
267267
} catch (InterruptedException ex) {
268268
fail("Interrupted ex");
269269
}
@@ -321,7 +321,7 @@ public void run() {
321321
rejected2.observe();
322322

323323
try {
324-
latch.await(10000, TimeUnit.MILLISECONDS);
324+
assertTrue(latch.await(10000, TimeUnit.MILLISECONDS));
325325
} catch (InterruptedException ex) {
326326
fail("Interrupted ex");
327327
}
@@ -374,7 +374,7 @@ public void testThreadPoolRejected() {
374374
rejected2.observe();
375375

376376
try {
377-
latch.await(10000, TimeUnit.MILLISECONDS);
377+
assertTrue(latch.await(10000, TimeUnit.MILLISECONDS));
378378
} catch (InterruptedException ex) {
379379
fail("Interrupted ex");
380380
}
@@ -405,7 +405,7 @@ public void testFallbackFailure() {
405405
cmd.observe();
406406

407407
try {
408-
latch.await(10000, TimeUnit.MILLISECONDS);
408+
assertTrue(latch.await(10000, TimeUnit.MILLISECONDS));
409409
} catch (InterruptedException ex) {
410410
fail("Interrupted ex");
411411
}
@@ -430,7 +430,7 @@ public void testFallbackMissing() {
430430
cmd.observe();
431431

432432
try {
433-
latch.await(10000, TimeUnit.MILLISECONDS);
433+
assertTrue(latch.await(10000, TimeUnit.MILLISECONDS));
434434
} catch (InterruptedException ex) {
435435
fail("Interrupted ex");
436436
}
@@ -475,7 +475,7 @@ public void testFallbackRejection() {
475475
rejection2.observe();
476476

477477
try {
478-
latch.await(10000, TimeUnit.MILLISECONDS);
478+
assertTrue(latch.await(10000, TimeUnit.MILLISECONDS));
479479
} catch (InterruptedException ex) {
480480
fail("Interrupted ex");
481481
}
@@ -505,7 +505,7 @@ public void testMultipleEventsOverTimeGetStoredAndDoNotAgeOut() {
505505
cmd2.observe();
506506

507507
try {
508-
latch.await(10000, TimeUnit.MILLISECONDS);
508+
assertTrue(latch.await(10000, TimeUnit.MILLISECONDS));
509509
} catch (InterruptedException ex) {
510510
fail("Interrupted ex");
511511
}

hystrix-core/src/test/java/com/netflix/hystrix/metric/consumer/HealthCountsStreamTest.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public void testEmptyStreamProducesZeros() {
8484
//no writes
8585

8686
try {
87-
latch.await(10000, TimeUnit.MILLISECONDS);
87+
assertTrue(latch.await(10000, TimeUnit.MILLISECONDS));
8888
} catch (InterruptedException ex) {
8989
fail("Interrupted ex");
9090
}
@@ -106,7 +106,7 @@ public void testSingleSuccess() {
106106
cmd.observe();
107107

108108
try {
109-
latch.await(10000, TimeUnit.MILLISECONDS);
109+
assertTrue(latch.await(10000, TimeUnit.MILLISECONDS));
110110
} catch (InterruptedException ex) {
111111
fail("Interrupted ex");
112112
}
@@ -128,7 +128,7 @@ public void testSingleFailure() {
128128
cmd.observe();
129129

130130
try {
131-
latch.await(10000, TimeUnit.MILLISECONDS);
131+
assertTrue(latch.await(10000, TimeUnit.MILLISECONDS));
132132
} catch (InterruptedException ex) {
133133
fail("Interrupted ex");
134134
}
@@ -150,7 +150,7 @@ public void testSingleTimeout() {
150150
cmd.observe();
151151

152152
try {
153-
latch.await(10000, TimeUnit.MILLISECONDS);
153+
assertTrue(latch.await(10000, TimeUnit.MILLISECONDS));
154154
} catch (InterruptedException ex) {
155155
fail("Interrupted ex");
156156
}
@@ -172,7 +172,7 @@ public void testSingleBadRequest() {
172172
cmd.observe();
173173

174174
try {
175-
latch.await(10000, TimeUnit.MILLISECONDS);
175+
assertTrue(latch.await(10000, TimeUnit.MILLISECONDS));
176176
} catch (InterruptedException ex) {
177177
fail("Interrupted ex");
178178
}
@@ -198,7 +198,7 @@ public void testRequestFromCache() {
198198
cmd3.observe();
199199

200200
try {
201-
latch.await(10000, TimeUnit.MILLISECONDS);
201+
assertTrue(latch.await(10000, TimeUnit.MILLISECONDS));
202202
} catch (InterruptedException ex) {
203203
fail("Interrupted ex");
204204
}
@@ -240,7 +240,7 @@ public void testShortCircuited() {
240240
shortCircuit2.observe();
241241

242242
try {
243-
latch.await(10000, TimeUnit.MILLISECONDS);
243+
assertTrue(latch.await(10000, TimeUnit.MILLISECONDS));
244244
} catch (InterruptedException ex) {
245245
fail("Interrupted ex");
246246
}
@@ -293,7 +293,7 @@ public void run() {
293293
rejected2.observe();
294294

295295
try {
296-
latch.await(10000, TimeUnit.MILLISECONDS);
296+
assertTrue(latch.await(10000, TimeUnit.MILLISECONDS));
297297
} catch (InterruptedException ex) {
298298
fail("Interrupted ex");
299299
}
@@ -340,7 +340,7 @@ public void testThreadPoolRejected() {
340340
rejected2.observe();
341341

342342
try {
343-
latch.await(10000, TimeUnit.MILLISECONDS);
343+
assertTrue(latch.await(10000, TimeUnit.MILLISECONDS));
344344
} catch (InterruptedException ex) {
345345
fail("Interrupted ex");
346346
}
@@ -365,7 +365,7 @@ public void testFallbackFailure() {
365365
cmd.observe();
366366

367367
try {
368-
latch.await(10000, TimeUnit.MILLISECONDS);
368+
assertTrue(latch.await(10000, TimeUnit.MILLISECONDS));
369369
} catch (InterruptedException ex) {
370370
fail("Interrupted ex");
371371
}
@@ -387,7 +387,7 @@ public void testFallbackMissing() {
387387
cmd.observe();
388388

389389
try {
390-
latch.await(10000, TimeUnit.MILLISECONDS);
390+
assertTrue(latch.await(10000, TimeUnit.MILLISECONDS));
391391
} catch (InterruptedException ex) {
392392
fail("Interrupted ex");
393393
}
@@ -428,7 +428,7 @@ public void testFallbackRejection() {
428428
rejection2.observe();
429429

430430
try {
431-
latch.await(10000, TimeUnit.MILLISECONDS);
431+
assertTrue(latch.await(10000, TimeUnit.MILLISECONDS));
432432
} catch (InterruptedException ex) {
433433
fail("Interrupted ex");
434434
}
@@ -454,7 +454,7 @@ public void testMultipleEventsOverTimeGetStoredAndAgeOut() {
454454
cmd2.observe();
455455

456456
try {
457-
latch.await(10000, TimeUnit.MILLISECONDS);
457+
assertTrue(latch.await(10000, TimeUnit.MILLISECONDS));
458458
} catch (InterruptedException ex) {
459459
fail("Interrupted ex");
460460
}

0 commit comments

Comments
 (0)