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 09:04:55 UTC

[GitHub] [drill] vvysotskyi commented on a change in pull request #1656: DRILL-7056: Drill fails with NPE when starting in distributed mode & …

vvysotskyi 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_r261967133
 
 

 ##########
 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) {
 
 Review comment:
   Please add checks for exception kind and error message.

----------------------------------------------------------------
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