alievmirza commented on code in PR #7512:
URL: https://github.com/apache/ignite-3/pull/7512#discussion_r2759455211
##########
modules/raft/src/integrationTest/java/org/apache/ignite/raft/jraft/core/ItNodeTest.java:
##########
@@ -4957,6 +5083,45 @@ private void triggerLeaderSnapshot(TestCluster cluster,
Node leader) throws Inte
triggerLeaderSnapshot(cluster, leader, 1);
}
+ /**
+ * Helper method to set up a single-node cluster with custom RaftOptions
for testing.
+ *
+ * @param raftOptions The RaftOptions to use for the node
+ * @return The started node (already elected as leader)
+ */
+ private Node setupSingleNodeClusterWithRaftOptions(RaftOptions
raftOptions, ApplyTaskMode mode) {
+ TestPeer peer = new TestPeer(testInfo, TestUtils.INIT_PORT);
+
+ NodeOptions nodeOptions = createNodeOptions(0);
+ nodeOptions.setApplyTaskMode(mode);
+ nodeOptions.setRaftOptions(raftOptions);
+ MockStateMachine fsm = new MockStateMachine(peer.getPeerId());
+ nodeOptions.setFsm(fsm);
+ nodeOptions.setRaftMetaUri(dataPath + File.separator + "meta");
+ nodeOptions.setSnapshotUri(dataPath + File.separator + "snapshot");
+ nodeOptions.setInitialConf(new
Configuration(Collections.singletonList(peer.getPeerId())));
+
+ RaftGroupService service = createService("unittest", peer,
nodeOptions, List.of());
+ Node node = service.start();
+
+ await().until(node::isLeader);
+
+ return node;
+ }
+
+ /**
+ * Helper method to get the current apply queue byte size for assertions.
+ *
+ * @param node The node to check
+ * @return The current applyQueueByteSize value
+ */
+ private static long getApplyQueueByteSize(Node node) throws Exception {
+ Field field = NodeImpl.class.getDeclaredField("applyQueueByteSize");
+ field.setAccessible(true);
+ LongAdder counter = (LongAdder) field.get(node);
Review Comment:
I don't want to expose `applyQueueByteSize` just for using it in test.
--
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]