[CONTROLLER-1532] CommitTransactionPayloadTest#testCandidateSerialization() fails Created: 12/Jul/16  Updated: 15/Jul/16  Resolved: 15/Jul/16

Status: Resolved
Project: controller
Component/s: mdsal
Affects Version/s: 0.4.0
Fix Version/s: None

Type: Bug
Reporter: Isaku Yamahata Assignee: Isaku Yamahata
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: 6186

 Description   

CommitTransactionPayloadTest#testCandidateSerialization() as follows

Running org.opendaylight.controller.cluster.datastore.persisted.CommitTransactionPayloadTest
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.233 sec <<< FAILURE! - in org.opendaylight.controller.cluster.datastore.persisted.CommitTransactionPayloadTest
testCandidateSerialization(org.opendaylight.controller.cluster.datastore.persisted.CommitTransactionPayloadTest) Time elapsed: 0.129 sec <<< FAILURE!
java.lang.AssertionError: payload size expected:<181> but was:<180>
at org.junit.Assert.fail(Assert.java:88)
at org.junit.Assert.failNotEquals(Assert.java:743)
at org.junit.Assert.assertEquals(Assert.java:118)
at org.junit.Assert.assertEquals(Assert.java:555)
at org.opendaylight.controller.cluster.datastore.persisted.CommitTransactionPayloadTest.testCandidateSerialization(CommitTransactionPayloadTest.java:116)

Results :

Failed tests:
CommitTransactionPayloadTest.testCandidateSerialization:116 payload size expected:<181> but was:<180>



 Comments   
Comment by Isaku Yamahata [ 12/Jul/16 ]

https://git.opendaylight.org/gerrit/#/c/41691/

Comment by Isaku Yamahata [ 12/Jul/16 ]

In order to reproduce it,
Once compile controller and then run only the test as follows.
mvn clean install
then
mvn -nsu '-Dtest=CommitTransactionPayloadTest#testCandidateSerialization' test -pl :sal-distributed-datastore

The root cause is that historic transaction id and transaction id can vary depending on the running order. And the payload size may vary depending on its value due to WritableObject#writeLongs() and #writeLong().

When the only test is run, historic id == 0 && transaction id == 0.

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