alievmirza commented on code in PR #5083:
URL: https://github.com/apache/ignite-3/pull/5083#discussion_r1939093424


##########
modules/raft/src/integrationTest/java/org/apache/ignite/raft/jraft/core/ItNodeTest.java:
##########
@@ -3506,6 +3507,102 @@ public void 
onRawConfigurationCommitted(ConfigurationEntry conf) {
         );
     }
 
+    @Test
+    public void testIndexAndTermOfCfgArePropagatedToSnapshotMeta() throws 
Exception {
+        TestPeer peer0 = new TestPeer(testInfo, TestUtils.INIT_PORT);
+
+        AtomicLong term = new AtomicLong(-1);
+        AtomicLong index = new AtomicLong(-1);
+
+        AtomicLong metaTerm = new AtomicLong(-1);
+        AtomicLong metaIndex = new AtomicLong(-1);
+
+        cluster = new TestCluster(
+                "testIndexAndTermOfCfgArePropagatedToSnapshotMeta",
+                dataPath,
+                Collections.singletonList(peer0),
+                new LinkedHashSet<>(),
+                ELECTION_TIMEOUT_MILLIS,
+                (peerId, opts) -> {
+                    opts.setFsm(new MockStateMachine(peerId) {
+                        @Override
+                        public boolean onSnapshotLoad(SnapshotReader reader) {
+                            SnapshotMeta meta = reader.load();
+
+                            metaTerm.set(meta.cfgTerm());
+                            metaIndex.set(meta.cfgIndex());

Review Comment:
   Snapshot load is triggered only on the node, that is restarted during the 
test.
   Other nodes needed to change configuration using 
`changePeersAndLearnersAsync`, and to force snapshot load on the restarting 
node 



-- 
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: notifications-unsubscr...@ignite.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to