Skip to content
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import org.apache.hadoop.yarn.server.resourcemanager.{ClientRMService, RMAppMana
import org.apache.hadoop.yarn.server.resourcemanager.ahs.RMApplicationHistoryWriter
import org.apache.hadoop.yarn.server.resourcemanager.metrics.SystemMetricsPublisher
import org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMApp
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.YarnScheduler
import org.apache.hadoop.yarn.server.security.ApplicationACLsManager
import org.apache.hadoop.yarn.util.Records
import org.mockito.ArgumentMatchers.{any, anyBoolean, anyShort, eq => meq}
Expand Down Expand Up @@ -245,7 +246,7 @@ class ClientSuite extends SparkFunSuite with Matchers {
request.setApplicationSubmissionContext(subContext)

val rmContext = mock(classOf[RMContext])
val conf = mock(classOf[Configuration])
val conf = new Configuration(false)
val map = new ConcurrentHashMap[ApplicationId, RMApp]()
when(rmContext.getRMApps).thenReturn(map)
val dispatcher = mock(classOf[Dispatcher])
Expand All @@ -262,7 +263,7 @@ class ClientSuite extends SparkFunSuite with Matchers {
when(appContext.getUnmanagedAM).thenReturn(true)

val rmAppManager = new RMAppManager(rmContext,
null,
mock(classOf[YarnScheduler]),
Copy link
Member Author

@dongjoon-hyun dongjoon-hyun May 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without this, NPE occurs at this.scheduler of Hadoop code.

null,
mock(classOf[ApplicationACLsManager]),
conf)
Expand All @@ -272,6 +273,7 @@ class ClientSuite extends SparkFunSuite with Matchers {
null,
null,
null)
clientRMService.init(conf)
clientRMService.submitApplication(request)

assert(map.get(subContext.getApplicationId).getApplicationType === targetType)
Expand Down