Skip to content

Commit

Permalink
fix fail test
Browse files Browse the repository at this point in the history
  • Loading branch information
wanghuaiyuan committed Jan 21, 2025
1 parent 07e720b commit 8bf70a4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1725,6 +1725,10 @@ public boolean isTimerStopDequeue() {
return timerStopDequeue;
}

public void setTimerStopDequeue(boolean timerStopDequeue) {
this.timerStopDequeue = timerStopDequeue;
}

public int getTimerMetricSmallThreshold() {
return timerMetricSmallThreshold;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@ public void testDoNormalTimer() throws Exception {
long commitOffset = timerMessageStore.getCommitOffset();
long curr = System.currentTimeMillis() / precisionMs * precisionMs;
long delayMs = curr + 3000;
storeConfig.setTimerStopDequeue(true);

for (int i = 0; i < 10; i++) {
for (int j = 0; j < 5; j++) {
MessageExtBrokerInner inner = buildMessage((i % 2 == 0) ? 3000 : delayMs, topic + i, i % 2 == 0);
Expand All @@ -207,7 +209,7 @@ public Boolean call() {
for (int i = 0; i < 10; i++) {
Assert.assertEquals(5, timerMessageStore.getTimerMetrics().getTimingCount(topic + i));
}

storeConfig.setTimerStopDequeue(false);
for (int i = 0; i < 10; i++) {
for (int j = 0; j < 5; j++) {
ByteBuffer msgBuff = getOneMessage(topic + i, 0, j, 4000);
Expand Down

0 comments on commit 8bf70a4

Please sign in to comment.