Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import java.lang.management.ManagementFactory;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ThreadLocalRandom;
import java.util.concurrent.TimeoutException;

import javax.management.AttributeNotFoundException;
import javax.management.InstanceNotFoundException;
Expand Down Expand Up @@ -325,7 +326,7 @@ public void testRollback() throws Exception {
out.write(data, 0, data.length);
out.close();

checkMxBeanIsNull();
waitForNullMxBean();
startRollingUpgrade(foo, bar, file, data, cluster);
checkMxBean();
cluster.getFileSystem().rollEdits();
Expand Down Expand Up @@ -356,6 +357,18 @@ public void testRollback() throws Exception {
}
}

private void waitForNullMxBean() throws TimeoutException, InterruptedException {
GenericTestUtils.waitFor(() -> {
try {
checkMxBeanIsNull();
return true;
} catch (Throwable t) {
LOG.error("Something went wrong.", t);
return false;
}
}, 100, 8000, "RollingUpgradeStatus is already set");
}

private static void startRollingUpgrade(Path foo, Path bar,
Path file, byte[] data,
MiniDFSCluster cluster) throws IOException {
Expand Down