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

Valery Kharseko
5 hours ago 08c730535481e1b982b5532a438a6779fe33dc88
refs
author Valery Kharseko <vharseko@3a-systems.ru>
Thursday, November 26, 2026 15:54 +0100
committer GitHub <noreply@github.com>
Thursday, November 26, 2026 15:54 +0100
commit08c730535481e1b982b5532a438a6779fe33dc88
tree 7e7cafcdc8baf14579d8e66d40b10c031df70e46 tree | zip | gz
parent b24036b260f7427f9b3624e247e2cf52b9042374 view | diff
Fix timing races in replication recovery tests (#1333)

## Summary

The expected CSN list could change while AssertJ was formatting a
transient mismatch in the recovery restart tests. The resulting
`ConcurrentModificationException` ended the test before the changelog
could catch up. [Failing Ubuntu Java 27 job on
master](https://github.com/OpenIdentityPlatform/OpenDJ/actions/runs/45762735252/job/139756560535)

Wait for the publisher to record the third CSN, then compare every read
of the changelog with the same immutable list. All three recovery
failure scenarios keep their exact ordering check and verify that the
next change is published after recovery. This follows the
synchronization used in #1274.

The first PR run passed all 70 `HistoricalCsnOrderingTest` cases on
Ubuntu with Java 27. The same job exposed a timing race in
`MissedUpdateRecoveryTest`. The test can receive the expected CSN before
the writer returns to the in-memory queue. Use the existing
`waitForFollowing(handler)` helper to verify that transition after
checking the delivered CSN and the warning. [Failing PR
job](https://github.com/OpenIdentityPlatform/OpenDJ/actions/runs/45784766650/job/139788644886)

## Validation

- The initial Maven precommit reactor `verify` on macOS with Java 27
passed all 98 tests across `HistoricalCsnOrderingTest`,
`HistoricalTest`, `AssuredReplicationPluginTest`, and
`LDAPReplicationDomainConfigChangeTest`.
- The follow-up Maven precommit reactor `verify` on macOS with Java 27
passed all 78 tests across `HistoricalCsnOrderingTest` and
`MissedUpdateRecoveryTest`, with zero failures, errors, or skips.
- `git diff --check` passed.
2 files modified
11 ■■■■■ changed files
opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/HistoricalCsnOrderingTest.java 6 ●●●●● diff | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/replication/server/MissedUpdateRecoveryTest.java 5 ●●●●● diff | view | raw | blame | history