Github user eyalfa commented on a diff in the pull request: https://github.com/apache/spark/pull/18855#discussion_r131912886 --- Diff: core/src/test/scala/org/apache/spark/storage/BlockManagerSuite.scala --- @@ -1415,6 +1415,79 @@ class BlockManagerSuite extends SparkFunSuite with Matchers with BeforeAndAfterE super.fetchBlockSync(host, port, execId, blockId) } } + + def testGetOrElseUpdateForLargeBlock(storageLevel : StorageLevel) { + store = makeBlockManager(6L * 1024 * 1024 * 1024, "exec1") + def mkBlobs() = { + val rng = new java.util.Random(42) + val buff = new Array[Byte](1024 * 1024) + rng.nextBytes(buff) + Iterator.fill(2 * 1024 + 1) { + buff + } + } + val res1 = store.getOrElseUpdate( + RDDBlockId(42, 0), + storageLevel, + implicitly[ClassTag[Array[Byte]]], + mkBlobs _ + ) + withClue(res1) { + assert(res1.isLeft) + assert(res1.left.get.data.zipAll(mkBlobs(), null, null).forall { + case (a, b) => --- End diff -- can't compare Arrays, you get identity equality which is usually not what you want. hence the `.seq` that forces it to be wrapped with a Seq
--- 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