Github user andrewor14 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/10170#discussion_r47021235
  
    --- Diff: 
core/src/test/scala/org/apache/spark/memory/UnifiedMemoryManagerSuite.scala ---
    @@ -78,33 +75,37 @@ class UnifiedMemoryManagerSuite extends 
MemoryManagerSuite with PrivateMethodTes
         val (mm, ms) = makeThings(maxMemory)
         assert(mm.storageMemoryUsed === 0L)
         assert(mm.acquireStorageMemory(dummyBlock, 10L, evictedBlocks))
    -    // `ensureFreeSpace` should be called with the number of bytes 
requested
    -    assertEnsureFreeSpaceCalled(ms, 10L)
    +    assertEvictBlocksToFreeSpaceNotCalled(ms)
         assert(mm.storageMemoryUsed === 10L)
    +
         assert(mm.acquireStorageMemory(dummyBlock, 100L, evictedBlocks))
    -    assertEnsureFreeSpaceCalled(ms, 100L)
    +    assertEvictBlocksToFreeSpaceNotCalled(ms)
         assert(mm.storageMemoryUsed === 110L)
    +    assert(evictedBlocks.isEmpty)
         // Acquire more than the max, not granted
         assert(!mm.acquireStorageMemory(dummyBlock, maxMemory + 1L, 
evictedBlocks))
    -    assertEnsureFreeSpaceCalled(ms, maxMemory + 1L)
    +    assertEvictBlocksToFreeSpaceNotCalled(ms)
         assert(mm.storageMemoryUsed === 110L)
    +    assert(evictedBlocks.isEmpty)
         // Acquire up to the max, requests after this are still granted due to 
LRU eviction
         assert(mm.acquireStorageMemory(dummyBlock, maxMemory, evictedBlocks))
    -    assertEnsureFreeSpaceCalled(ms, 1000L)
    +    assertEvictBlocksToFreeSpaceCalled(ms, 110L)
         assert(mm.storageMemoryUsed === 1000L)
    +    assert(evictedBlocks.nonEmpty)
    --- End diff --
    
    OK to keep, but I don't think there's a lot to gain from asserting this


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to