rpuch commented on code in PR #2704:
URL: https://github.com/apache/ignite-3/pull/2704#discussion_r1363320242
##########
modules/index/src/test/java/org/apache/ignite/internal/index/IndexBuildControllerTest.java:
##########
@@ -179,10 +181,43 @@ void testStopBuildIndexesOnChangePrimaryReplica() {
verify(indexBuilder).stopBuildingIndexes(tableId(), PARTITION_ID);
}
+ @Test
+ void
testStartBuildIndexesOnPrimaryReplicaElectedOnlyForRegisteredIndexes() {
+ createIndex(INDEX_NAME);
+
+ int indexId = indexId(INDEX_NAME);
+
+ makeIndexAvailable(indexId);
+
+ setPrimaryReplicaWitchExpireInOneSecond(PARTITION_ID, NODE_NAME,
clock.now());
+
+ verify(indexBuilder, never()).scheduleBuildIndex(
Review Comment:
When verifying that something does NOT happen, probably, it makes sense to
use as wide matchers as possible (that is, `any()`/`anyInt()`/... instead of
`eq(tableId())` and so on) to make sure we don't miss an invocation because we
made a mistake in the matchers.
##########
modules/index/src/test/java/org/apache/ignite/internal/index/IndexBuildControllerTest.java:
##########
@@ -179,10 +181,43 @@ void testStopBuildIndexesOnChangePrimaryReplica() {
verify(indexBuilder).stopBuildingIndexes(tableId(), PARTITION_ID);
}
+ @Test
+ void
testStartBuildIndexesOnPrimaryReplicaElectedOnlyForRegisteredIndexes() {
+ createIndex(INDEX_NAME);
+
+ int indexId = indexId(INDEX_NAME);
+
+ makeIndexAvailable(indexId);
+
+ setPrimaryReplicaWitchExpireInOneSecond(PARTITION_ID, NODE_NAME,
clock.now());
Review Comment:
```suggestion
setPrimaryReplicaWhichExpiresInOneSecond(PARTITION_ID, NODE_NAME,
clock.now());
```
##########
modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/TableTestUtils.java:
##########
@@ -26,10 +26,7 @@
import org.apache.ignite.internal.catalog.commands.ColumnParams;
import org.apache.ignite.internal.catalog.commands.CreateTableCommand;
-/**
- * Utils to manage tables inside tests.
- */
-// TODO: IGNITE-19502 - remove after switching to the Catalog.
+/** Utils to manage tables inside tests. */
Review Comment:
Let's remove the class altogether: it's not used anywhere (at least, on the
`main`). I forgot to remove it when I did a cleanup.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]