Skip to content

Commit 49570ed

Browse files
uncleGenkayousterhout
authored andcommitted
[SPARK-19803][TEST] flaky BlockManagerReplicationSuite test failure
## What changes were proposed in this pull request? 200ms may be too short. Give more time for replication to happen and new block be reported to master ## How was this patch tested? test manully Author: uncleGen <[email protected]> Author: dylon <[email protected]> Closes #17144 from uncleGen/SPARK-19803.
1 parent d69aeea commit 49570ed

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

core/src/test/scala/org/apache/spark/storage/BlockManagerReplicationSuite.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -489,12 +489,12 @@ class BlockManagerProactiveReplicationSuite extends BlockManagerReplicationBehav
489489
Thread.sleep(200)
490490
}
491491

492-
// giving enough time for replication complete and locks released
493-
Thread.sleep(500)
494-
495-
val newLocations = master.getLocations(blockId).toSet
492+
val newLocations = eventually(timeout(5 seconds), interval(10 millis)) {
493+
val _newLocations = master.getLocations(blockId).toSet
494+
assert(_newLocations.size === replicationFactor)
495+
_newLocations
496+
}
496497
logInfo(s"New locations : $newLocations")
497-
assert(newLocations.size === replicationFactor)
498498
// there should only be one common block manager between initial and new locations
499499
assert(newLocations.intersect(blockLocations.toSet).size === 1)
500500

0 commit comments

Comments
 (0)