Fix intermittent unit test failures
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / test / java / org / opendaylight / controller / cluster / datastore / ThreePhaseCommitCohortProxyTest.java
index 676667d..3014f7e 100644 (file)
@@ -345,17 +345,17 @@ public class ThreePhaseCommitCohortProxyTest extends AbstractActorTest {
         @Override
         public void onReceive(Object message) {
             if(CanCommitTransaction.isSerializedType(message)) {
+                canCommitCount.incrementAndGet();
                 onMessage("CanCommitTransaction", message, CanCommitTransaction.fromSerializable(message),
                         builder.expCanCommitType, builder.canCommitReply);
-                canCommitCount.incrementAndGet();
             } else if(CommitTransaction.isSerializedType(message)) {
+                commitCount.incrementAndGet();
                 onMessage("CommitTransaction", message, CommitTransaction.fromSerializable(message),
                         builder.expCommitType, builder.commitReply);
-                commitCount.incrementAndGet();
             } else if(AbortTransaction.isSerializedType(message)) {
+                abortCount.incrementAndGet();
                 onMessage("AbortTransaction", message, AbortTransaction.fromSerializable(message),
                         builder.expAbortType, builder.abortReply);
-                abortCount.incrementAndGet();
             } else {
                 assertionError = new AssertionError("Unexpected message " + message);
             }