ARTEMIS-4252 Refine waitForBridges
This commit is contained in:
parent
cc9db6b2f7
commit
126765decc
|
@ -632,7 +632,9 @@ public final class ClusterConnectionImpl implements ClusterConnection, AfterConn
|
|||
|
||||
@Override
|
||||
public Bridge[] getBridges() {
|
||||
return records.values().stream().map(MessageFlowRecord::getBridge).toArray(Bridge[]::new);
|
||||
synchronized (recordsGuard) {
|
||||
return records.values().stream().map(MessageFlowRecord::getBridge).toArray(Bridge[]::new);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -121,7 +121,6 @@ import org.apache.activemq.artemis.core.server.JournalType;
|
|||
import org.apache.activemq.artemis.core.server.MessageReference;
|
||||
import org.apache.activemq.artemis.core.server.NodeManager;
|
||||
import org.apache.activemq.artemis.core.server.Queue;
|
||||
import org.apache.activemq.artemis.core.server.cluster.Bridge;
|
||||
import org.apache.activemq.artemis.core.server.cluster.ClusterConnection;
|
||||
import org.apache.activemq.artemis.core.server.cluster.ClusterManager;
|
||||
import org.apache.activemq.artemis.core.server.cluster.RemoteQueueBinding;
|
||||
|
@ -1335,8 +1334,6 @@ public abstract class ActiveMQTestBase extends Assert {
|
|||
}
|
||||
|
||||
protected static final void waitForBridges(ClusterConnection clusterConnection, int connectedBridges) throws Exception {
|
||||
Bridge[] bridges = clusterConnection.getBridges();
|
||||
|
||||
Wait.assertTrue(() -> Arrays.stream(clusterConnection.getBridges())
|
||||
.filter(bridge -> bridge.isConnected()).count() >= connectedBridges);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue