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

    https://github.com/apache/spark/pull/7927#discussion_r36235472
  
    --- Diff: 
core/src/test/scala/org/apache/spark/storage/BlockManagerSuite.scala ---
    @@ -443,6 +443,21 @@ class BlockManagerSuite extends SparkFunSuite with 
Matchers with BeforeAndAfterE
         assert(list2DiskGet.get.readMethod === DataReadMethod.Disk)
       }
     
    +  test("block manager crash test") {
    +    conf.set("spark.network.timeout", "5s")
    +    store = makeBlockManager(8000)
    +    store2 = makeBlockManager(8000)
    +    val list1 = List(new Array[Byte](4000))
    +    store2.putIterator("list1", list1.iterator, StorageLevel.MEMORY_ONLY, 
tellMaster = true)
    +    val list1Get = store.getRemote("list1")
    +    assert(list1Get.isDefined, "list1get expected to be fetched")
    +    // simulate block manager crashed
    +    store2.stop()
    +    val list1GetAgain = store.getRemoteBytes("list1")
    +    assert(!list1GetAgain.isDefined, "list1getagain expected to be not 
fetched")
    +    conf.set("spark.network.timeout", "120s")
    --- End diff --
    
    This statement looks like it should be unnecessary but I guess it's not 
since it looks like this test is mutating a shared configuration. Is there any 
way to avoid this type of coupling between tests or to ensure that the previous 
state is restored in a `finally` block or `afterEach()` method?


---
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]

Reply via email to