Skip to content

Commit

Permalink
Fix DelayEntryTest might failed (apache#16176)
Browse files Browse the repository at this point in the history
Co-authored-by: xiangzihao <[email protected]>
  • Loading branch information
ruanwenjun and SbloodyS authored Jun 19, 2024
1 parent 5df4b1c commit 4c5dacf
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@

package org.apache.dolphinscheduler.server.master.runner.queue;

import static com.google.common.truth.Truth.assertThat;

import java.util.concurrent.TimeUnit;

import org.junit.jupiter.api.Test;

import com.google.common.truth.Truth;

class DelayEntryTest {

@Test
void getDelay() {
DelayEntry<String> delayEntry = new DelayEntry<>(1_000L, "Item");
Truth.assertThat(delayEntry.getDelay(TimeUnit.NANOSECONDS))
.isWithin(100)
.of(TimeUnit.NANOSECONDS.convert(1_000L, TimeUnit.MILLISECONDS));
DelayEntry<String> delayEntry = new DelayEntry<>(5_000L, "Item");
assertThat(delayEntry.getDelay(TimeUnit.NANOSECONDS))
.isWithin(500)
.of(TimeUnit.NANOSECONDS.convert(5_000L, TimeUnit.MILLISECONDS));
}
}

0 comments on commit 4c5dacf

Please sign in to comment.