Skip to content

Commit

Permalink
[fix][test] testModularLoadManagerRemoveBundleAndLoad (#19710)
Browse files Browse the repository at this point in the history
  • Loading branch information
AnonHxy authored Mar 6, 2023
1 parent e13865c commit 4ed8a87
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
import java.util.Optional;
import java.util.Set;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;
import lombok.Cleanup;
Expand Down Expand Up @@ -823,10 +823,10 @@ private void waitResourceDataUpdateToZK(LoadManager loadManager) throws Exceptio
// Wait until "ModularLoadManager" completes processing the ZK notification.
ModularLoadManagerWrapper modularLoadManagerWrapper = (ModularLoadManagerWrapper) loadManager;
ModularLoadManagerImpl modularLoadManager = (ModularLoadManagerImpl) modularLoadManagerWrapper.getLoadManager();
ScheduledExecutorService scheduler = (ScheduledExecutorService) FieldUtils.readField(
modularLoadManager, "scheduler", true);
ExecutorService executors = (ExecutorService) FieldUtils.readField(
modularLoadManager, "executors", true);
CompletableFuture<Void> waitForNoticeHandleFinishByLoadManager = new CompletableFuture<>();
scheduler.execute(() -> waitForNoticeHandleFinishByLoadManager.complete(null));
executors.execute(() -> waitForNoticeHandleFinishByLoadManager.complete(null));
waitForNoticeHandleFinishByLoadManager.join();
// Manually trigger "LoadResourceQuotaUpdaterTask"
loadManager.writeResourceQuotasToZooKeeper();
Expand Down

0 comments on commit 4ed8a87

Please sign in to comment.