drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [drill] kkhatua commented on a change in pull request #1656: DRILL-7056: Drill fails with NPE when starting in distributed mode & …
Date Mon, 04 Mar 2019 18:17:47 GMT
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_r262181604
 
 

 ##########
 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:
   Strange that my Eclipse IDE didn't catch this. 

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

Mime
View raw message