This commit is contained in:
1 parent
b724a21a0d
commit
d73fa2c435
45 files changed
+2733
-226
No files matched your search
@@ -17,12 +17,17 @@ public final class AdminOperationsTest {
|
||||
}
|
||||
|
||||
private static AdminBulkJobs.Snapshot await(AdminBulkJobs jobs, String id) throws Exception {
|
||||
for (int retry = 0; retry < 200; retry++) {
|
||||
long deadline = System.nanoTime() + java.util.concurrent.TimeUnit.SECONDS.toNanos(60);
|
||||
while (System.nanoTime() < deadline) {
|
||||
AdminBulkJobs.Snapshot snapshot = jobs.get(id);
|
||||
if (snapshot.finished() != 0) return snapshot;
|
||||
Thread.sleep(25);
|
||||
}
|
||||
throw new AssertionError("Bulk job did not finish");
|
||||
jobs.cancel(id);
|
||||
long cancellationDeadline = System.nanoTime() + java.util.concurrent.TimeUnit.SECONDS.toNanos(30);
|
||||
while (jobs.get(id).finished() == 0 && System.nanoTime() < cancellationDeadline)
|
||||
Thread.sleep(25);
|
||||
throw new AssertionError("Bulk job did not finish: " + jobs.get(id));
|
||||
}
|
||||
|
||||
private static void copySafety(DiskStore store) throws Exception {
|
||||
|
||||
Reference in new issue
Block a user