diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/resourceplugin/gpu/TestGpuDiscoverer.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/resourceplugin/gpu/TestGpuDiscoverer.java index a70e668146e..f0f100c1f8b 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/resourceplugin/gpu/TestGpuDiscoverer.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/resourceplugin/gpu/TestGpuDiscoverer.java @@ -505,7 +505,7 @@ public class TestGpuDiscoverer { Configuration conf = new Configuration(); conf.set(YarnConfiguration.NM_GPU_ALLOWED_DEVICES, "0:1,2:3"); - GpuDiscoverer gpuSpy = spy(GpuDiscoverer.class); + GpuDiscoverer gpuSpy = spy(new GpuDiscoverer()); gpuSpy.initialize(conf); gpuSpy.getGpusUsableByYarn();