Skip to content

Commit 31ded88

Browse files
committed
Remove redundancy in a test
1 parent d632a50 commit 31ded88

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

src/test/java/com/spotify/reaper/service/RepairRunnerTest.java

+3-11
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,12 @@ public void setUp() throws Exception {
2424
}
2525

2626
@Test
27-
public void runTest() throws InterruptedException {
27+
public void noSegmentsTest() throws InterruptedException {
2828
final int RUN_ID = 1;
2929
final int CF_ID = 1;
3030
final double INTENSITY = 0.5f;
3131
final long TIME_CREATION = 41l;
3232
final long TIME_START = 42l;
33-
final long TIME_END = 43l;
3433

3534
// place a dummy repair run into the storage
3635
DateTimeUtils.setCurrentMillisFixed(TIME_CREATION);
@@ -50,17 +49,10 @@ public void runTest() throws InterruptedException {
5049
assertNotNull(startTime);
5150
assertEquals(TIME_START, startTime.getMillis());
5251

53-
// end the repair
54-
DateTimeUtils.setCurrentMillisFixed(TIME_END);
55-
RepairRun run = storage.getRepairRun(RUN_ID);
56-
storage.updateRepairRun(run.with().runState(RepairRun.RunState.RUNNING).build(RUN_ID));
57-
RepairRunner.startNewRepairRun(storage, RUN_ID);
58-
Thread.sleep(200);
59-
60-
// check if the end time was properly set
52+
// end time will also be set immediately
6153
DateTime endTime = storage.getRepairRun(RUN_ID).getEndTime();
6254
assertNotNull(endTime);
63-
assertEquals(TIME_END, endTime.getMillis());
55+
assertEquals(TIME_START, endTime.getMillis());
6456
}
6557

6658
}

0 commit comments

Comments
 (0)