Skip to content

Commit

Permalink
Fix mocks in RapidsShuffleServerSuite
Browse files Browse the repository at this point in the history
  • Loading branch information
abellina committed May 22, 2023
1 parent 4f78c56 commit 3fd1e28
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class RapidsShuffleServerSuite extends RapidsShuffleTestHelper {
val stream = invocation.getArgument[Cuda.Stream](4)
dst.copyFromMemoryBuffer(dstOffset, deviceBuffer, srcOffset, length, stream)
}
when(mockBuffer.getMemoryUsedBytes).thenReturn(deviceBuffer.getLength)
when(mockBuffer.getPackedSizeBytes).thenReturn(deviceBuffer.getLength)
when(mockBuffer.meta).thenReturn(mockMeta)
mockBuffer
}
Expand Down Expand Up @@ -230,7 +230,7 @@ class RapidsShuffleServerSuite extends RapidsShuffleTestHelper {
withResource(new RefCountedDirectByteBuffer(bb)) { _ =>
val tableMeta = MetaUtils.buildTableMeta(1, 456, bb, 100)
when(rapidsBuffer.meta).thenReturn(tableMeta)
when(rapidsBuffer.getMemoryUsedBytes).thenReturn(tableMeta.bufferMeta().size())
when(rapidsBuffer.getPackedSizeBytes).thenReturn(tableMeta.bufferMeta().size())
when(mockRequestHandler.acquireShuffleBuffer(ArgumentMatchers.eq(1)))
.thenReturn(rapidsBuffer)

Expand Down Expand Up @@ -287,7 +287,7 @@ class RapidsShuffleServerSuite extends RapidsShuffleTestHelper {
withResource(new RefCountedDirectByteBuffer(bb)) { _ =>
val tableMeta = MetaUtils.buildTableMeta(1, 456, bb, 100)
when(rapidsBuffer.meta).thenReturn(tableMeta)
when(rapidsBuffer.getMemoryUsedBytes).thenReturn(tableMeta.bufferMeta().size())
when(rapidsBuffer.getPackedSizeBytes).thenReturn(tableMeta.bufferMeta().size())
when(mockRequestHandler.acquireShuffleBuffer(ArgumentMatchers.eq(1)))
.thenReturn(rapidsBuffer)

Expand Down Expand Up @@ -371,7 +371,7 @@ class RapidsShuffleServerSuite extends RapidsShuffleTestHelper {
val rapidsBuffer = mock[RapidsBuffer]
val tableMeta = MetaUtils.buildTableMeta(tableId, 456, bb, 100)
when(rapidsBuffer.meta).thenReturn(tableMeta)
when(rapidsBuffer.getMemoryUsedBytes).thenReturn(tableMeta.bufferMeta().size())
when(rapidsBuffer.getPackedSizeBytes).thenReturn(tableMeta.bufferMeta().size())
when(mockRequestHandler.acquireShuffleBuffer(ArgumentMatchers.eq(tableId)))
.thenReturn(rapidsBuffer)
rapidsBuffer
Expand Down

0 comments on commit 3fd1e28

Please sign in to comment.