mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Jean-Noel Rouvignac
01.45.2015 71cc55da9ba5f23e25c7f5aea50ed7ff039372e1
ChangelogBackendTestCase.java:
Hopefully say forever goodbye to randomness of searchInChangeNumberModeOnOneSuffixMultipleTimes().

The fixxed assertion error message was:
Failure Cause: java.lang.AssertionError: [In entry dn:
firstchangenumber: 1
lastchangenumber: 8
changelog: cn=changelog
lastExternalChangelogCookie: o=test:00000149a520c3ed04b10000000a;
incorrect value for attr 'lastchangenumber']
Expecting:
<"8">
to be equal to:
<"9">
ignoring case considerations
org.opends.server.backends.ChangelogBackendTestCase.assertAttributeValue(ChangelogBackendTestCase.java:1381)
org.opends.server.backends.ChangelogBackendTestCase.assertChangelogAttributesInRootDSE(ChangelogBackendTestCase.java:857)
org.opends.server.backends.ChangelogBackendTestCase.searchInChangeNumberModeOnOneSuffixMultipleTimes(ChangelogBackendTestCase.java:588)


The error was due to the CSN of the 9nth change coming after the previous CSN, based on time.
How is that possible? I have absolutely no idea since both were created by using which should never go backwards AFAIK.
1 files modified
4 ■■■ changed files
opendj-sdk/opendj-server-legacy/src/test/java/org/opends/server/backends/ChangelogBackendTestCase.java 4 ●●● patch | view | raw | blame | history
opendj-sdk/opendj-server-legacy/src/test/java/org/opends/server/backends/ChangelogBackendTestCase.java
@@ -590,7 +590,9 @@
    assertChangelogAttributesInRootDSE(true, 1, 8);
    // add a new change, then check again first and last change number without previous search
    CSN csn = new CSN(TimeThread.getTime(), 10, SERVER_ID_1);
    testName = "Multiple/9";
    CSN lastCsn = csns[csns.length - 1];
    CSN csn = new CSN(lastCsn.getTime() + 1, 9, SERVER_ID_1);
    publishUpdateMessagesInOTest(testName, false, generateDeleteMsg(DN_OTEST, csn, testName, 1));
    assertChangelogAttributesInRootDSE(true, 1, 9);