HDDS-1174. Freon tests are failing with null pointer exception.

Contributed by Shashikant Banerjee.
This commit is contained in:
Anu Engineer 2019-02-26 14:33:54 -08:00
parent a106d2dc9d
commit a5a751b418
1 changed files with 6 additions and 2 deletions

View File

@ -215,7 +215,9 @@ public final class RandomKeyGenerator implements Callable<Void> {
for (FreonOps ops : FreonOps.values()) { for (FreonOps ops : FreonOps.values()) {
histograms.add(ops.ordinal(), new Histogram(new UniformReservoir())); histograms.add(ops.ordinal(), new Histogram(new UniformReservoir()));
} }
freon.startHttpServer(); if (freon != null) {
freon.startHttpServer();
}
} }
@Override @Override
@ -296,7 +298,9 @@ public final class RandomKeyGenerator implements Callable<Void> {
Runtime.getRuntime().addShutdownHook( Runtime.getRuntime().addShutdownHook(
new Thread(() -> { new Thread(() -> {
printStats(System.out); printStats(System.out);
freon.stopHttpServer(); if (freon != null) {
freon.stopHttpServer();
}
})); }));
} }
/** /**