Skip to content

Commit

Permalink
Fix misnamed test method name
Browse files Browse the repository at this point in the history
The method has nothing to do with system memory.
  • Loading branch information
findepi committed Jan 12, 2022
1 parent 22a52ce commit 1bb3e84
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -194,17 +194,17 @@ public void testBlockingOnRevocableMemoryFreeUser()
assertTrue(userPool.tryReserve(fakeQueryId, "test", TEN_MEGABYTES_WITHOUT_TWO_BYTES.toBytes()));

// we expect 2 iterations as we have 2 bytes remaining in memory pool and we allocate 1 byte per page
assertEquals(runDriversUntilBlocked(waitingForRevocableSystemMemory()), 2);
assertEquals(runDriversUntilBlocked(waitingForRevocableMemory()), 2);
assertTrue(userPool.getFreeBytes() <= 0, format("Expected empty pool but got [%d]", userPool.getFreeBytes()));

// lets free 5 bytes
userPool.free(fakeQueryId, "test", 5);
assertEquals(runDriversUntilBlocked(waitingForRevocableSystemMemory()), 5);
assertEquals(runDriversUntilBlocked(waitingForRevocableMemory()), 5);
assertTrue(userPool.getFreeBytes() <= 0, format("Expected empty pool but got [%d]", userPool.getFreeBytes()));

// 3 more bytes is enough for driver to finish
userPool.free(fakeQueryId, "test", 3);
assertDriversProgress(waitingForRevocableSystemMemory());
assertDriversProgress(waitingForRevocableMemory());
assertEquals(userPool.getFreeBytes(), 10);
}

Expand All @@ -215,15 +215,15 @@ public void testBlockingOnRevocableMemoryFreeViaRevoke()
assertTrue(userPool.tryReserve(fakeQueryId, "test", TEN_MEGABYTES_WITHOUT_TWO_BYTES.toBytes()));

// we expect 2 iterations as we have 2 bytes remaining in memory pool and we allocate 1 byte per page
assertEquals(runDriversUntilBlocked(waitingForRevocableSystemMemory()), 2);
assertEquals(runDriversUntilBlocked(waitingForRevocableMemory()), 2);
revocableMemoryOperator.getOperatorContext().requestMemoryRevoking();

// 2 more iterations
assertEquals(runDriversUntilBlocked(waitingForRevocableSystemMemory()), 2);
assertEquals(runDriversUntilBlocked(waitingForRevocableMemory()), 2);
revocableMemoryOperator.getOperatorContext().requestMemoryRevoking();

// 3 more bytes is enough for driver to finish
assertDriversProgress(waitingForRevocableSystemMemory());
assertDriversProgress(waitingForRevocableMemory());
assertEquals(userPool.getFreeBytes(), 2);
}

Expand Down Expand Up @@ -330,7 +330,7 @@ private Predicate<OperatorContext> waitingForUserMemory()
return (OperatorContext operatorContext) -> !operatorContext.isWaitingForMemory().isDone();
}

private Predicate<OperatorContext> waitingForRevocableSystemMemory()
private Predicate<OperatorContext> waitingForRevocableMemory()
{
return (OperatorContext operatorContext) ->
!operatorContext.isWaitingForRevocableMemory().isDone() &&
Expand Down

0 comments on commit 1bb3e84

Please sign in to comment.