Skip to content

Commit 2e5f9a8

Browse files
committed
Create rpcEnv and run later needs shutdown and awaitTermination
Signed-off-by: 10087686 <[email protected]>
1 parent 3218505 commit 2e5f9a8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

core/src/test/scala/org/apache/spark/rpc/RpcEnvSuite.scala

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,12 @@ abstract class RpcEnvSuite extends SparkFunSuite with BeforeAndAfterAll {
633633

634634
test("port conflict") {
635635
val anotherEnv = createRpcEnv(new SparkConf(), "remote", env.address.port)
636-
assert(anotherEnv.address.port != env.address.port)
636+
try {
637+
assert(anotherEnv.address.port != env.address.port)
638+
} finally {
639+
anotherEnv.shutdown()
640+
anotherEnv.awaitTermination()
641+
}
637642
}
638643

639644
private def testSend(conf: SparkConf): Unit = {

0 commit comments

Comments
 (0)