Skip to content

Commit 0980757

Browse files
committed
Verify no leftover heartbeats after any singleRebuild
1 parent 274988b commit 0980757

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/provider/foundationdb/OnlineIndexerBuildIndexTest.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
import com.apple.foundationdb.async.AsyncUtil;
2424
import com.apple.foundationdb.async.RangeSet;
25+
import com.apple.foundationdb.record.IndexBuildProto;
2526
import com.apple.foundationdb.record.IndexState;
2627
import com.apple.foundationdb.record.logging.KeyValueLogMessage;
2728
import com.apple.foundationdb.record.logging.LogMessageKeys;
@@ -45,6 +46,7 @@
4546
import java.util.List;
4647
import java.util.Map;
4748
import java.util.Objects;
49+
import java.util.UUID;
4850
import java.util.concurrent.CompletableFuture;
4951
import java.util.concurrent.CompletionException;
5052
import java.util.concurrent.ThreadLocalRandom;
@@ -304,6 +306,10 @@ <M extends Message> void singleRebuild(
304306
));
305307
}
306308
}
309+
try (OnlineIndexer indexBuilder = newIndexerBuilder(index).build()) {
310+
final Map<UUID, IndexBuildProto.IndexBuildHeartbeat> heartbeats = indexBuilder.getIndexingHeartbeats(0);
311+
assertTrue(heartbeats.isEmpty());
312+
}
307313
KeyValueLogMessage msg = KeyValueLogMessage.build("building index - completed", TestLogMessageKeys.INDEX, index);
308314
msg.addKeysAndValues(timer.getKeysAndValues());
309315
LOGGER.info(msg.toString());

0 commit comments

Comments
 (0)