Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1271,6 +1271,7 @@ boolean isOutliersReportDue(long curTime) {

void forceFullBlockReportNow() {
forceFullBlockReport.set(true);
resetBlockReportTime = true;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,23 @@ public void testScheduleNextBlockReport3() {
}
}

/**
* force trigger full block report multi times, the next block report
* must be scheduled in the range (now + BLOCK_REPORT_INTERVAL_SEC).
*/
@Test
public void testScheduleNextBlockReport4() {
for (final long now : getTimestamps()) {
Scheduler scheduler = makeMockScheduler(now);
for (int i = 0; i < getTimestamps().size(); ++i) {
scheduler.forceFullBlockReportNow();
scheduler.scheduleNextBlockReport();
}
assertTrue(scheduler.getNextBlockReportTime() - now >= 0);
assertTrue(scheduler.getNextBlockReportTime() - now <= BLOCK_REPORT_INTERVAL_MS);
}
}

@Test
public void testScheduleHeartbeat() {
for (final long now : getTimestamps()) {
Expand Down