Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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 @@ -412,7 +412,7 @@ private static Tracer createTracer(Configuration conf) {

private ScheduledThreadPoolExecutor metricsLoggerTimer;

private final long startTime = now();
private long startTime = 0;

/**
* Creates a dummy DataNode for testing purpose.
Expand Down Expand Up @@ -2721,6 +2721,7 @@ public void runDatanodeDaemon() throws IOException {
}
ipcServer.setTracer(tracer);
ipcServer.start();
startTime = now();
startPlugins(getConf());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ public void testDataNodeMXBean() throws Exception {
Assert.assertEquals(datanode.getVersion(),version);
// get attribute "DNStartedTimeInMillis"
long startTime = (long) mbs.getAttribute(mxbeanName, "DNStartedTimeInMillis");
Assert.assertTrue("Datanode start time should not be 0", startTime > 0);
Assert.assertEquals(datanode.getDNStartedTimeInMillis(), startTime);
// get attribute "SotfwareVersion"
String softwareVersion =
Expand Down