Skip to content

Commit

Permalink
add test assert back
Browse files Browse the repository at this point in the history
  • Loading branch information
alecgrieser committed Nov 10, 2022
1 parent f3baaf8 commit 91feb09
Showing 1 changed file with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@
import java.util.concurrent.ThreadLocalRandom;
import java.util.function.Function;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.allOf;
import static org.hamcrest.Matchers.greaterThanOrEqualTo;
import static org.hamcrest.Matchers.lessThanOrEqualTo;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNull;
Expand Down Expand Up @@ -312,13 +316,14 @@ void singleRebuild(@Nonnull List<TestRecords1Proto.MySimpleRecord> records,
}
}

/*
assertThat(indexBuilder.getTotalRecordsScanned(),
allOf(
greaterThanOrEqualTo((long)records.size()),
lessThanOrEqualTo((long)records.size() + additionalScans)
));
*/
int deletedRecordCount = deleteWhileBuilding == null ? 0 : deleteWhileBuilding.size();
if (sourceIndex == null || getIndexMaintenanceFilter().equals(IndexMaintenanceFilter.NORMAL)) {
assertThat(indexBuilder.getTotalRecordsScanned(),
allOf(
greaterThanOrEqualTo((long)(records.size() - deletedRecordCount)),
lessThanOrEqualTo((long)records.size() + additionalScans)
));
}
}
KeyValueLogMessage msg = KeyValueLogMessage.build("building index - completed", TestLogMessageKeys.INDEX, index);
msg.addKeysAndValues(timer.getKeysAndValues());
Expand Down

0 comments on commit 91feb09

Please sign in to comment.