From 661dc06886df4738b9add2206a39d74d7dedf476 Mon Sep 17 00:00:00 2001
From: Valery Kharseko <vharseko@3a-systems.ru>
Date: Thu, 10 Sep 2026 11:57:37 +0000
Subject: [PATCH] [#908] Wait for the changes being applied before a domain going down saves its ServerState (#945)

---
 opendj-server-legacy/src/test/java/org/opends/server/replication/service/FakeReplicationDomain.java |   32 +++++++++++++++++++++++++++++++-
 1 files changed, 31 insertions(+), 1 deletions(-)

diff --git a/opendj-server-legacy/src/test/java/org/opends/server/replication/service/FakeReplicationDomain.java b/opendj-server-legacy/src/test/java/org/opends/server/replication/service/FakeReplicationDomain.java
index 90589a2..f116f66 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/replication/service/FakeReplicationDomain.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/replication/service/FakeReplicationDomain.java
@@ -13,7 +13,7 @@
  *
  * Copyright 2008-2010 Sun Microsystems, Inc.
  * Portions Copyright 2013-2016 ForgeRock AS.
- * Portions Copyright 2025 3A Systems LLC.
+ * Portions Copyright 2025-2026 3A Systems LLC.
  */
 package org.opends.server.replication.service;
 
@@ -46,6 +46,16 @@
   /** A StringBuffer that will be used to build a new String should the import be called. */
   private StringBuffer importString;
   private int exportedEntryCount;
+  /**
+   * What {@code importInProgress()} said while this domain was inside
+   * {@link #importBackend(InputStream)}, and {@code null} when it was never there.
+   */
+  private volatile Boolean importReportedDuringImport;
+  /**
+   * What {@code importInProgress()} said while this domain was inside
+   * {@link #exportBackend(OutputStream)}, and {@code null} when it was never there.
+   */
+  private volatile Boolean importReportedDuringExport;
 
   private FakeReplicationDomain(DN baseDN, int serverID,
       SortedSet<String> replicationServers, int window, long heartbeatInterval,
@@ -104,9 +114,28 @@
     return exportedEntryCount;
   }
 
+  /**
+   * Returns what {@code importInProgress()} said while this domain was inside
+   * {@code importBackend()}, or {@code null} when it never was.
+   */
+  Boolean importReportedDuringImport()
+  {
+    return importReportedDuringImport;
+  }
+
+  /**
+   * Returns what {@code importInProgress()} said while this domain was inside
+   * {@code exportBackend()}, or {@code null} when it never was.
+   */
+  Boolean importReportedDuringExport()
+  {
+    return importReportedDuringExport;
+  }
+
   @Override
   protected void exportBackend(OutputStream output) throws DirectoryException
   {
+    importReportedDuringExport = importInProgress();
     try
     {
       output.write(exportString.getBytes());
@@ -122,6 +151,7 @@
   @Override
   protected void importBackend(InputStream input) throws DirectoryException
   {
+    importReportedDuringImport = importInProgress();
     byte[] buffer = new byte[1000];
     int ret;
     do

--
Gitblit v1.10.0