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

Valery Kharseko
12 hours ago 7be21fdb29a1d8a18e14e1a90d21b9d5215bf511
refs
author Valery Kharseko <vharseko@3a-systems.ru>
Wednesday, November 18, 2026 07:37 +0100
committer GitHub <noreply@github.com>
Wednesday, November 18, 2026 07:37 +0100
commit7be21fdb29a1d8a18e14e1a90d21b9d5215bf511
tree 0b5012dba198a4e4c9c9dd209851ddb725565cea tree | zip | gz
parent cdee5509885cfc626b83e8479402422338946c4e view | diff
[#1303] Wait for both sides of replication initialization (#1304)

## Problem

The replication initialization tests check the exporter's
remaining-entry counter as soon as the importer has received all bytes.
The exporter can publish the complete entry message before updating its
counter, so the test can observe all 5,000 entries and still read 5,000
remaining.

## Changes

- Wait for successful completion of both the importer and the exporter,
and record each counter on the thread that updates it before its context
is released. Retain the data and import/export direction checks, and
reject an unexpected import retry.
- Exercise the reported interleaving across two replication servers by
holding the exporter after it publishes the entry message. Also hold the
export result after the import succeeds to verify that the check waits
for both sides.
- Verify that an import failure after receiving the data cannot be
reported as a successful transfer.

Fixes #1303

## Validation

- `ReplicationDomainTest`: 42 tests passed on Java 21, with no failures
or skips.
- The controlled interleaving reproduced the original `expected [0] but
found [5000]` failure before the fix. Removing the exporter-completion
wait made the new test fail at its second synchronization point.
- `git diff --check` passed.
1 files modified
369 ■■■■■ changed files
opendj-server-legacy/src/test/java/org/opends/server/replication/service/ReplicationDomainTest.java 369 ●●●●● diff | view | raw | blame | history