You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/engine/TickerScheduleEngineTests.java
+4-8Lines changed: 4 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -312,14 +312,13 @@ public void testWatchWithLastCheckedTimeExecutesBeforeInitialInterval() throws E
312
312
313
313
engine.register(events -> {
314
314
for (TriggerEventignored : events) {
315
-
if (runCount.get() == 0) {
315
+
if (runCount.getAndIncrement() == 0) {
316
316
logger.info("job first fire");
317
317
firstLatch.countDown();
318
318
} else {
319
319
logger.info("job second fire");
320
320
secondLatch.countDown();
321
321
}
322
-
runCount.incrementAndGet();
323
322
}
324
323
});
325
324
@@ -375,14 +374,13 @@ public void testWatchWithNoLastCheckedTimeButHasActivationTimeExecutesBeforeInit
375
374
376
375
engine.register(events -> {
377
376
for (TriggerEventignored : events) {
378
-
if (runCount.get() == 0) {
377
+
if (runCount.getAndIncrement() == 0) {
379
378
logger.info("job first fire");
380
379
firstLatch.countDown();
381
380
} else {
382
381
logger.info("job second fire");
383
382
secondLatch.countDown();
384
383
}
385
-
runCount.incrementAndGet();
386
384
}
387
385
});
388
386
@@ -428,14 +426,13 @@ public void testAddWithLastCheckedTimeExecutesBeforeInitialInterval() throws Exc
428
426
429
427
engine.register(events -> {
430
428
for (TriggerEventignored : events) {
431
-
if (runCount.get() == 0) {
429
+
if (runCount.getAndIncrement() == 0) {
432
430
logger.info("job first fire");
433
431
firstLatch.countDown();
434
432
} else {
435
433
logger.info("job second fire");
436
434
secondLatch.countDown();
437
435
}
438
-
runCount.incrementAndGet();
439
436
}
440
437
});
441
438
@@ -492,14 +489,13 @@ public void testAddWithNoLastCheckedTimeButHasActivationTimeExecutesBeforeInitia
0 commit comments