DBZ-4727 Make wait for snapshot event generic
This commit is contained in:
parent
13c9e517ef
commit
65bfeeccea
@ -1159,6 +1159,10 @@ public static int waitTimeForRecordsAfterNulls() {
|
||||
}
|
||||
|
||||
public static void waitForSnapshotToBeCompleted(String connector, String server) throws InterruptedException {
|
||||
waitForSnapshotEvent(connector, server, "SnapshotCompleted");
|
||||
}
|
||||
|
||||
private static void waitForSnapshotEvent(String connector, String server, String event) throws InterruptedException {
|
||||
final MBeanServer mbeanServer = ManagementFactory.getPlatformMBeanServer();
|
||||
|
||||
Awaitility.await()
|
||||
@ -1167,7 +1171,7 @@ public static void waitForSnapshotToBeCompleted(String connector, String server)
|
||||
.atMost(waitTimeForRecords() * 30, TimeUnit.SECONDS)
|
||||
.ignoreException(InstanceNotFoundException.class)
|
||||
.until(() -> (boolean) mbeanServer
|
||||
.getAttribute(getSnapshotMetricsObjectName(connector, server), "SnapshotCompleted"));
|
||||
.getAttribute(getSnapshotMetricsObjectName(connector, server), event));
|
||||
}
|
||||
|
||||
public static void waitForStreamingRunning(String connector, String server) throws InterruptedException {
|
||||
|
Loading…
Reference in New Issue
Block a user