Skip to content

Commit

Permalink
update ut
Browse files Browse the repository at this point in the history
  • Loading branch information
FMX committed Feb 18, 2025
1 parent 215ce5e commit ec31df6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,11 @@ public interface ReadBufferTargetChangeListener {
void onChange(long newMemoryTarget);
}

@VisibleForTesting
public static void clearInstance() {
_INSTANCE = null;
}

public enum ServingState {
NONE_PAUSED,
PUSH_AND_REPLICATE_PAUSED,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,10 @@ public long[] prepare(int mapCount) {
conf.set(CelebornConf.WORKER_READBUFFER_ALLOCATIONWAIT().key(), "10ms");

StorageManager storageManager = Mockito.mock(StorageManager.class);
Mockito.when(storageManager.storageBufferAllocator()).thenReturn(allocator);
MemoryManager.clearInstance();
MemoryManager.initialize(conf, storageManager, null);
partitionDataWriter = Mockito.mock(PartitionDataWriter.class);
Mockito.when(storageManager.storageBufferAllocator()).thenReturn(allocator);
when(partitionDataWriter.getMemoryFileInfo()).thenAnswer(i -> fileInfo);

return partitionSize;
Expand Down

0 comments on commit ec31df6

Please sign in to comment.