Github user andrewor14 commented on a diff in the pull request:
https://github.com/apache/spark/pull/10170#discussion_r47012533
--- Diff:
core/src/test/scala/org/apache/spark/memory/MemoryManagerSuite.scala ---
@@ -36,105 +37,98 @@ import org.apache.spark.storage.{BlockId, BlockStatus,
MemoryStore, StorageLevel
/**
* Helper trait for sharing code among [[MemoryManager]] tests.
*/
-private[memory] trait MemoryManagerSuite extends SparkFunSuite {
+private[memory] trait MemoryManagerSuite extends SparkFunSuite with
BeforeAndAfterEach {
- import MemoryManagerSuite.DEFAULT_ENSURE_FREE_SPACE_CALLED
+ protected val evictedBlocks = new mutable.ArrayBuffer[(BlockId,
BlockStatus)]
+
+ import MemoryManagerSuite.DEFAULT_EVICT_BLOCKS_TO_FREE_SPACE_CALLED
// Note: Mockito's verify mechanism does not provide a way to reset
method call counts
// without also resetting stubbed methods. Since our test code relies on
the latter,
- // we need to use our own variable to track invocations of
`ensureFreeSpace`.
+ // we need to use our own variable to track invocations of
`evictBlocksToFreeSpace`.
/**
- * The amount of free space requested in the last call to
[[MemoryStore.ensureFreeSpace]]
+ * The amount of space requested in the last call to
[[MemoryStore.evictBlocksToFreeSpace]].
*
- * This set whenever [[MemoryStore.ensureFreeSpace]] is called, and
cleared when the test
- * code makes explicit assertions on this variable through
[[assertEnsureFreeSpaceCalled]].
+ * This set whenever [[MemoryStore.evictBlocksToFreeSpace]] is called,
and cleared when the test
+ * code makes explicit assertions on this variable through
+ * [[assertEvictBlocksToFreeSpaceCalled]].
*/
- private val ensureFreeSpaceCalled = new
AtomicLong(DEFAULT_ENSURE_FREE_SPACE_CALLED)
+ private val evictBlocksToFreeSpaceCalled = new AtomicLong(0)
--- End diff --
I see, you do this in `beforeEach` anyway
---
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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]