You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by GitBox <gi...@apache.org> on 2019/03/04 18:04:24 UTC
[GitHub] [drill] kkhatua commented on a change in pull request #1656: DRILL-7056: Drill fails with NPE when starting in distributed mode & …
kkhatua commented on a change in pull request #1656: DRILL-7056: Drill fails with NPE when starting in distributed mode & …
URL: https://github.com/apache/drill/pull/1656#discussion_r262176829
##########
File path: exec/java-exec/src/test/java/org/apache/drill/test/TestGracefulShutdown.java
##########
@@ -205,6 +212,47 @@ public void testDrillbitWithSamePortContainsShutdownThread() throws Exception {
}
}
+ @Test // DRILL-7056
+ public void testDrillbitTempDir() throws Exception {
+ File originalDrillbitTempDir = null;
+ ClusterFixtureBuilder fixtureBuilder = ClusterFixture.bareBuilder(dirTestWatcher).withLocalZk()
+ .configProperty(ExecConstants.ALLOW_LOOPBACK_ADDRESS_BINDING, true)
+ .configProperty(ExecConstants.INITIAL_USER_PORT, QueryTestUtil.getFreePortNumber(31170, 300))
+ .configProperty(ExecConstants.INITIAL_BIT_PORT, QueryTestUtil.getFreePortNumber(31180, 300));
+
+ try (ClusterFixture fixture = fixtureBuilder.build();
+ Drillbit twinDrillbitOnSamePort = new Drillbit(fixture.config(),
+ fixtureBuilder.configBuilder().getDefinitions(), fixture.serviceSet())) {
+ // Assert preconditions :
+ // 1. First drillbit instance should be started normally
+ // 2. Second instance startup should fail, because ports are occupied by the first one
+ Drillbit originalDrillbit = fixture.drillbit();
+ assertNotNull("First drillbit instance should be initialized", originalDrillbit);
+ originalDrillbitTempDir = getWebServerTempDirPath(originalDrillbit);
+ assertTrue("First drillbit instance should have a temporary Javascript dir initialized", originalDrillbitTempDir.exists());
+ try {
+ twinDrillbitOnSamePort.run();
+ fail("Invocation of 'twinDrillbitOnSamePort.run()' should throw UserException");
+ } catch (UserException e) {
+ assertNull("Second drillbit instance should NOT have a temporary Javascript dir", getWebServerTempDirPath(twinDrillbitOnSamePort));
Review comment:
I test by calling the method because the non-started drillbit is still instantiated, but failed to come up.
The method will not create a temp dir if the startup failed. I thought it was a valid test.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services