[CONTROLLER-1419] Clustering: LeaderTest failure in sal-akka-raft Created: 31/Aug/15  Updated: 31/Oct/15  Resolved: 31/Oct/15

Status: Resolved
Project: controller
Component/s: clustering
Affects Version/s: Lithium
Fix Version/s: None

Type: Bug
Reporter: Shaleen Saxena Assignee: Tom Pantelis
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


External issue ID: 4223

 Description   

I'm seeing failures in LeaderTest.java in my setup.
After executing 'mvn clean install' in sal-akka-raft, I get:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.18:test (default-test) on project sal-akka-raft: There are test failures.
[ERROR]
[ERROR] Please refer to /home/ssaxena/Work/controller/opendaylight/md-sal/sal-akka-raft/target/surefire-reports for the individual test results.

The output in .../sal-akka-raft/target/surefire-reports/org.opendaylight.controller.cluster.raft.behaviors.LeaderTest.txt:

-------------------------------------------------------------------------------
Test set: org.opendaylight.controller.cluster.raft.behaviors.LeaderTest
-------------------------------------------------------------------------------
Tests run: 39, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 11.033 sec <<< FAILURE! - in org.opendaylight.controller.cluster.raft.behaviors.LeaderTest
testInitiateInstallSnapshot(org.opendaylight.controller.cluster.raft.behaviors.LeaderTest) Time elapsed: 5.054 sec <<< FAILURE!
java.lang.AssertionError: Did not receive message of type class org.opendaylight.controller.cluster.raft.messages.AppendEntries
at org.junit.Assert.fail(Assert.java:88)
at org.opendaylight.controller.cluster.raft.utils.MessageCollectorActor.expectFirstMatching(MessageCollectorActor.java:125)
at org.opendaylight.controller.cluster.raft.utils.MessageCollectorActor.expectFirstMatching(MessageCollectorActor.java:108)
at org.opendaylight.controller.cluster.raft.behaviors.LeaderTest.testInitiateInstallSnapshot(LeaderTest.java:617)



 Comments   
Comment by Tom Pantelis [ 31/Oct/15 ]

I've seen similar intermittent failure in various test cases in LeaderTest. It always happens when the leader sends the first AppendEntries to the follower however the message goes to dead letters, which normally occurs and/or is supposed to occur when an actor is killed. This seems to be a timing issue/bug in akka, possibly with ActorSelection - maybe the actor isn't in a state to receive messages yet.

I came up with a solution in https://git.opendaylight.org/gerrit/#/c/29027 that appears to alleviate the issue as the LeaderTest ran successfully over 1000 times.

Generated at Wed Feb 07 19:55:30 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.