sanpwc commented on code in PR #4446:
URL: https://github.com/apache/ignite-3/pull/4446#discussion_r1871132777


##########
modules/placement-driver-api/src/testFixtures/java/org/apache/ignite/internal/placementdriver/TestPlacementDriver.java:
##########
@@ -112,8 +112,29 @@ public Supplier<? extends ReplicaMeta> 
getPrimaryReplicaSupplier() {
         return this.primaryReplicaSupplier;
     }
 
-    public void setPrimaryReplicaSupplier(Supplier<? extends ReplicaMeta> 
primaryReplicaSupplier) {
+    /**
+     * Setter for a test primary replica supplier with {@code 
PRIMARY_REPLICA_ELECTED} event firing that is crucial for some tests internal
+     * logic that depends on the event handling.
+     *
+     * @param primaryReplicaSupplier The supplier that provides {@link 
TestReplicaMetaImpl} instance with a test primary replica meta
+     *      information.
+     */
+    public void setPrimaryReplicaSupplier(Supplier<? extends 
TestReplicaMetaImpl> primaryReplicaSupplier) {
         this.primaryReplicaSupplier = primaryReplicaSupplier;
+
+        TestReplicaMetaImpl replicaMeta = primaryReplicaSupplier.get();
+
+        fireEvent(
+                PrimaryReplicaEvent.PRIMARY_REPLICA_ELECTED,
+                new PrimaryReplicaEventParameters(
+                        0,

Review Comment:
   Makes sense. 



-- 
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