[jira] [Commented] (DRILL-5973) Support injection of time-bound pauses in server

2017-11-30 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-5973?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16273077#comment-16273077
 ] 

ASF GitHub Bot commented on DRILL-5973:
---

Github user laurentgo commented on a diff in the pull request:

https://github.com/apache/drill/pull/1055#discussion_r154150476
  
--- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/testing/ExecutionControlsInjector.java
 ---
@@ -81,8 +83,20 @@ public void injectPause(final ExecutionControls 
executionControls, final String
   executionControls.lookupPauseInjection(this, desc);
 
 if (pauseInjection != null) {
-  logger.debug("Pausing at {}", desc);
-  pauseInjection.pause();
+  long pauseDuration = pauseInjection.getMsPause();
+  if ( pauseDuration > 0L) {
--- End diff --

maybe nitpicky but I would use -1 (or any negative value) to distinguish 
between timed-bounded pause or not (since 0 is a valid wait time for 
CountDownLatch)


> Support injection of time-bound pauses in server
> 
>
> Key: DRILL-5973
> URL: https://issues.apache.org/jira/browse/DRILL-5973
> Project: Apache Drill
>  Issue Type: Improvement
>  Components: Tools, Build & Test
>Affects Versions: 1.11.0
>Reporter: Kunal Khatua
>Assignee: Kunal Khatua
> Fix For: 1.13.0
>
>
> While working on DRILL-3640 , when creating a unit test for a server-induced 
> timeout, the injecting a pause leaves the JUnit framework's DrillClient 
> without a handle to the query on the server. This is because we injected the 
> pause to occur before the server could send back a query ID, so the 
> DrillClient has no way to unpause the server.
> The workaround to support this unit test is to allow for injecting pauses 
> with a defined time-bound, after which the server would resume.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (DRILL-5973) Support injection of time-bound pauses in server

2017-11-30 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-5973?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16273076#comment-16273076
 ] 

ASF GitHub Bot commented on DRILL-5973:
---

Github user laurentgo commented on a diff in the pull request:

https://github.com/apache/drill/pull/1055#discussion_r154153787
  
--- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/testing/ExecutionControlsInjector.java
 ---
@@ -81,8 +83,20 @@ public void injectPause(final ExecutionControls 
executionControls, final String
   executionControls.lookupPauseInjection(this, desc);
 
 if (pauseInjection != null) {
-  logger.debug("Pausing at {}", desc);
-  pauseInjection.pause();
+  long pauseDuration = pauseInjection.getMsPause();
+  if ( pauseDuration > 0L) {
+logger.debug("Pausing at {} for {} sec", desc, 
TimeUnit.MILLISECONDS.toSeconds(pauseDuration) );
+  } else {
+logger.debug("Pausing at {}", desc);
+  }
+  try {
+pauseInjection.pause();
+  } catch (InterruptedException e) {
+//Unpause if this is a timed pause, because an explicit unpause is 
not called
+if (pauseDuration > 0L) {
--- End diff --

maybe to be done in PauseInjection (seems like something internal)


> Support injection of time-bound pauses in server
> 
>
> Key: DRILL-5973
> URL: https://issues.apache.org/jira/browse/DRILL-5973
> Project: Apache Drill
>  Issue Type: Improvement
>  Components: Tools, Build & Test
>Affects Versions: 1.11.0
>Reporter: Kunal Khatua
>Assignee: Kunal Khatua
> Fix For: 1.13.0
>
>
> While working on DRILL-3640 , when creating a unit test for a server-induced 
> timeout, the injecting a pause leaves the JUnit framework's DrillClient 
> without a handle to the query on the server. This is because we injected the 
> pause to occur before the server could send back a query ID, so the 
> DrillClient has no way to unpause the server.
> The workaround to support this unit test is to allow for injecting pauses 
> with a defined time-bound, after which the server would resume.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (DRILL-5973) Support injection of time-bound pauses in server

2017-11-30 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-5973?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16273075#comment-16273075
 ] 

ASF GitHub Bot commented on DRILL-5973:
---

Github user laurentgo commented on a diff in the pull request:

https://github.com/apache/drill/pull/1055#discussion_r154153939
  
--- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/testing/PauseInjection.java 
---
@@ -44,14 +46,31 @@ private PauseInjection(@JsonProperty("address") final 
String address,
  @JsonProperty("siteClass") final String siteClass,
  @JsonProperty("desc") final String desc,
  @JsonProperty("nSkip") final int nSkip) throws 
InjectionConfigurationException {
-super(address, port, siteClass, desc, nSkip, 1);
+//nFire is 1 since we will inject pauses only once
+//msPause is 0 (i.e. not time-bound)
+super(address, port, siteClass, desc, nSkip, 1, 0L);
+  }
+
+  @JsonCreator // ensures instances are created only through JSON
+  private PauseInjection(@JsonProperty("address") final String address,
+ @JsonProperty("port") final int port,
+ @JsonProperty("siteClass") final String siteClass,
+ @JsonProperty("desc") final String desc,
+ @JsonProperty("nSkip") final int nSkip,
+ @JsonProperty("msPause") final long msPause) 
throws InjectionConfigurationException {
+//nFire is 1 since we will inject pauses only once
+super(address, port, siteClass, desc, nSkip, 1, msPause);
   }
 
-  public void pause() {
+  public void pause() throws InterruptedException {
--- End diff --

I would not expose the interruption but handle it internally instead (by 
decreasing the latch counter)


> Support injection of time-bound pauses in server
> 
>
> Key: DRILL-5973
> URL: https://issues.apache.org/jira/browse/DRILL-5973
> Project: Apache Drill
>  Issue Type: Improvement
>  Components: Tools, Build & Test
>Affects Versions: 1.11.0
>Reporter: Kunal Khatua
>Assignee: Kunal Khatua
> Fix For: 1.13.0
>
>
> While working on DRILL-3640 , when creating a unit test for a server-induced 
> timeout, the injecting a pause leaves the JUnit framework's DrillClient 
> without a handle to the query on the server. This is because we injected the 
> pause to occur before the server could send back a query ID, so the 
> DrillClient has no way to unpause the server.
> The workaround to support this unit test is to allow for injecting pauses 
> with a defined time-bound, after which the server would resume.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (DRILL-5973) Support injection of time-bound pauses in server

2017-11-30 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-5973?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16273772#comment-16273772
 ] 

ASF GitHub Bot commented on DRILL-5973:
---

Github user kkhatua commented on a diff in the pull request:

https://github.com/apache/drill/pull/1055#discussion_r154246413
  
--- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/testing/ExecutionControlsInjector.java
 ---
@@ -81,8 +83,20 @@ public void injectPause(final ExecutionControls 
executionControls, final String
   executionControls.lookupPauseInjection(this, desc);
 
 if (pauseInjection != null) {
-  logger.debug("Pausing at {}", desc);
-  pauseInjection.pause();
+  long pauseDuration = pauseInjection.getMsPause();
+  if ( pauseDuration > 0L) {
--- End diff --

Agreed, but the only purpose of that check is to indicate during debugging 
that a non-zero timed pause was injected. Hence, the check.


> Support injection of time-bound pauses in server
> 
>
> Key: DRILL-5973
> URL: https://issues.apache.org/jira/browse/DRILL-5973
> Project: Apache Drill
>  Issue Type: Improvement
>  Components: Tools, Build & Test
>Affects Versions: 1.11.0
>Reporter: Kunal Khatua
>Assignee: Kunal Khatua
> Fix For: 1.13.0
>
>
> While working on DRILL-3640 , when creating a unit test for a server-induced 
> timeout, the injecting a pause leaves the JUnit framework's DrillClient 
> without a handle to the query on the server. This is because we injected the 
> pause to occur before the server could send back a query ID, so the 
> DrillClient has no way to unpause the server.
> The workaround to support this unit test is to allow for injecting pauses 
> with a defined time-bound, after which the server would resume.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (DRILL-5851) Empty table during a join operation with a non empty table produces cast exception

2017-11-30 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-5851?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16273782#comment-16273782
 ] 

ASF GitHub Bot commented on DRILL-5851:
---

GitHub user HanumathRao opened a pull request:

https://github.com/apache/drill/pull/1059

DRILL-5851: Empty table during a join operation with a non empty tabl…

…e produces cast exception.

These code changes handle the cases where either of the table in a join is 
empty and we do not need to process the join further. @paul-rogers 
@amansinha100 Please review these changes.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/HanumathRao/drill DRILL-5851-lat

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/drill/pull/1059.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #1059


commit dbdffa51b802ae6c799264836ad86cc39d34fee2
Author: Hanumath Maduri 
Date:   2017-10-09T20:08:13Z

DRILL-5851: Empty table during a join operation with a non empty table 
produces cast exception.




> Empty table during a join operation with a non empty table produces cast 
> exception 
> ---
>
> Key: DRILL-5851
> URL: https://issues.apache.org/jira/browse/DRILL-5851
> Project: Apache Drill
>  Issue Type: Bug
>  Components: Execution - Relational Operators
>Affects Versions: 1.11.0
>Reporter: Hanumath Rao Maduri
>Assignee: Hanumath Rao Maduri
>
> Hash Join operation on tables with one table empty and the other non empty 
> throws an exception 
> {code} 
> Error: SYSTEM ERROR: DrillRuntimeException: Join only supports implicit casts 
> between 1. Numeric data
>  2. Varchar, Varbinary data 3. Date, Timestamp data Left type: VARCHAR, Right 
> type: INT. Add explicit casts to avoid this error
> {code}
> Here is an example query with which it is reproducible.
> {code}
> select * from cp.`sample-data/nation.parquet` nation left outer join 
> dfs.tmp.`2.csv` as two on two.a = nation.`N_COMMENT`;
> {code}
> the contents of 2.csv is empty (i.e not even header info).



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (DRILL-5973) Support injection of time-bound pauses in server

2017-11-30 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-5973?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16273777#comment-16273777
 ] 

ASF GitHub Bot commented on DRILL-5973:
---

Github user kkhatua commented on a diff in the pull request:

https://github.com/apache/drill/pull/1055#discussion_r154246723
  
--- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/testing/ExecutionControlsInjector.java
 ---
@@ -81,8 +83,20 @@ public void injectPause(final ExecutionControls 
executionControls, final String
   executionControls.lookupPauseInjection(this, desc);
 
 if (pauseInjection != null) {
-  logger.debug("Pausing at {}", desc);
-  pauseInjection.pause();
+  long pauseDuration = pauseInjection.getMsPause();
+  if ( pauseDuration > 0L) {
+logger.debug("Pausing at {} for {} sec", desc, 
TimeUnit.MILLISECONDS.toSeconds(pauseDuration) );
+  } else {
+logger.debug("Pausing at {}", desc);
+  }
+  try {
+pauseInjection.pause();
+  } catch (InterruptedException e) {
+//Unpause if this is a timed pause, because an explicit unpause is 
not called
+if (pauseDuration > 0L) {
--- End diff --

Just following convention of 'unpausing' explicitly, rather than implicitly 
within the `pause()` for a limited-duration pause.


> Support injection of time-bound pauses in server
> 
>
> Key: DRILL-5973
> URL: https://issues.apache.org/jira/browse/DRILL-5973
> Project: Apache Drill
>  Issue Type: Improvement
>  Components: Tools, Build & Test
>Affects Versions: 1.11.0
>Reporter: Kunal Khatua
>Assignee: Kunal Khatua
> Fix For: 1.13.0
>
>
> While working on DRILL-3640 , when creating a unit test for a server-induced 
> timeout, the injecting a pause leaves the JUnit framework's DrillClient 
> without a handle to the query on the server. This is because we injected the 
> pause to occur before the server could send back a query ID, so the 
> DrillClient has no way to unpause the server.
> The workaround to support this unit test is to allow for injecting pauses 
> with a defined time-bound, after which the server would resume.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (DRILL-5973) Support injection of time-bound pauses in server

2017-11-30 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-5973?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16273785#comment-16273785
 ] 

ASF GitHub Bot commented on DRILL-5973:
---

Github user kkhatua commented on a diff in the pull request:

https://github.com/apache/drill/pull/1055#discussion_r154247418
  
--- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/testing/ExecutionControlsInjector.java
 ---
@@ -81,8 +83,20 @@ public void injectPause(final ExecutionControls 
executionControls, final String
   executionControls.lookupPauseInjection(this, desc);
 
 if (pauseInjection != null) {
-  logger.debug("Pausing at {}", desc);
-  pauseInjection.pause();
+  long pauseDuration = pauseInjection.getMsPause();
+  if ( pauseDuration > 0L) {
+logger.debug("Pausing at {} for {} sec", desc, 
TimeUnit.MILLISECONDS.toSeconds(pauseDuration) );
+  } else {
+logger.debug("Pausing at {}", desc);
+  }
+  try {
+pauseInjection.pause();
+  } catch (InterruptedException e) {
+//Unpause if this is a timed pause, because an explicit unpause is 
not called
+if (pauseDuration > 0L) {
--- End diff --

Will make the change since the InterruptedException is being handled in the 
timed pause (based on your comment below).


> Support injection of time-bound pauses in server
> 
>
> Key: DRILL-5973
> URL: https://issues.apache.org/jira/browse/DRILL-5973
> Project: Apache Drill
>  Issue Type: Improvement
>  Components: Tools, Build & Test
>Affects Versions: 1.11.0
>Reporter: Kunal Khatua
>Assignee: Kunal Khatua
> Fix For: 1.13.0
>
>
> While working on DRILL-3640 , when creating a unit test for a server-induced 
> timeout, the injecting a pause leaves the JUnit framework's DrillClient 
> without a handle to the query on the server. This is because we injected the 
> pause to occur before the server could send back a query ID, so the 
> DrillClient has no way to unpause the server.
> The workaround to support this unit test is to allow for injecting pauses 
> with a defined time-bound, after which the server would resume.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (DRILL-5973) Support injection of time-bound pauses in server

2017-11-30 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-5973?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16273783#comment-16273783
 ] 

ASF GitHub Bot commented on DRILL-5973:
---

Github user kkhatua commented on a diff in the pull request:

https://github.com/apache/drill/pull/1055#discussion_r154247369
  
--- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/testing/PauseInjection.java 
---
@@ -44,14 +46,31 @@ private PauseInjection(@JsonProperty("address") final 
String address,
  @JsonProperty("siteClass") final String siteClass,
  @JsonProperty("desc") final String desc,
  @JsonProperty("nSkip") final int nSkip) throws 
InjectionConfigurationException {
-super(address, port, siteClass, desc, nSkip, 1);
+//nFire is 1 since we will inject pauses only once
+//msPause is 0 (i.e. not time-bound)
+super(address, port, siteClass, desc, nSkip, 1, 0L);
+  }
+
+  @JsonCreator // ensures instances are created only through JSON
+  private PauseInjection(@JsonProperty("address") final String address,
+ @JsonProperty("port") final int port,
+ @JsonProperty("siteClass") final String siteClass,
+ @JsonProperty("desc") final String desc,
+ @JsonProperty("nSkip") final int nSkip,
+ @JsonProperty("msPause") final long msPause) 
throws InjectionConfigurationException {
+//nFire is 1 since we will inject pauses only once
+super(address, port, siteClass, desc, nSkip, 1, msPause);
   }
 
-  public void pause() {
+  public void pause() throws InterruptedException {
--- End diff --

Agreed. 


> Support injection of time-bound pauses in server
> 
>
> Key: DRILL-5973
> URL: https://issues.apache.org/jira/browse/DRILL-5973
> Project: Apache Drill
>  Issue Type: Improvement
>  Components: Tools, Build & Test
>Affects Versions: 1.11.0
>Reporter: Kunal Khatua
>Assignee: Kunal Khatua
> Fix For: 1.13.0
>
>
> While working on DRILL-3640 , when creating a unit test for a server-induced 
> timeout, the injecting a pause leaves the JUnit framework's DrillClient 
> without a handle to the query on the server. This is because we injected the 
> pause to occur before the server could send back a query ID, so the 
> DrillClient has no way to unpause the server.
> The workaround to support this unit test is to allow for injecting pauses 
> with a defined time-bound, after which the server would resume.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (DRILL-5973) Support injection of time-bound pauses in server

2017-11-30 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-5973?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16273789#comment-16273789
 ] 

ASF GitHub Bot commented on DRILL-5973:
---

Github user laurentgo commented on a diff in the pull request:

https://github.com/apache/drill/pull/1055#discussion_r154248201
  
--- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/testing/ExecutionControlsInjector.java
 ---
@@ -81,8 +83,20 @@ public void injectPause(final ExecutionControls 
executionControls, final String
   executionControls.lookupPauseInjection(this, desc);
 
 if (pauseInjection != null) {
-  logger.debug("Pausing at {}", desc);
-  pauseInjection.pause();
+  long pauseDuration = pauseInjection.getMsPause();
+  if ( pauseDuration > 0L) {
+logger.debug("Pausing at {} for {} sec", desc, 
TimeUnit.MILLISECONDS.toSeconds(pauseDuration) );
+  } else {
+logger.debug("Pausing at {}", desc);
+  }
+  try {
+pauseInjection.pause();
+  } catch (InterruptedException e) {
+//Unpause if this is a timed pause, because an explicit unpause is 
not called
+if (pauseDuration > 0L) {
--- End diff --

did you forget to remove that part following up on your other change?


> Support injection of time-bound pauses in server
> 
>
> Key: DRILL-5973
> URL: https://issues.apache.org/jira/browse/DRILL-5973
> Project: Apache Drill
>  Issue Type: Improvement
>  Components: Tools, Build & Test
>Affects Versions: 1.11.0
>Reporter: Kunal Khatua
>Assignee: Kunal Khatua
> Fix For: 1.13.0
>
>
> While working on DRILL-3640 , when creating a unit test for a server-induced 
> timeout, the injecting a pause leaves the JUnit framework's DrillClient 
> without a handle to the query on the server. This is because we injected the 
> pause to occur before the server could send back a query ID, so the 
> DrillClient has no way to unpause the server.
> The workaround to support this unit test is to allow for injecting pauses 
> with a defined time-bound, after which the server would resume.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (DRILL-5973) Support injection of time-bound pauses in server

2017-11-30 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-5973?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16273790#comment-16273790
 ] 

ASF GitHub Bot commented on DRILL-5973:
---

Github user laurentgo commented on a diff in the pull request:

https://github.com/apache/drill/pull/1055#discussion_r154247977
  
--- Diff: 
exec/java-exec/src/test/java/org/apache/drill/exec/testing/TestPauseInjection.java
 ---
@@ -144,6 +144,34 @@ public void pauseInjected() {
 }
   }
 
+  @Test
+  public void timedPauseInjected() {
+final long pauseDuration = 2000L;
+final long expectedDuration = pauseDuration;
+final ExtendedLatch trigger = new ExtendedLatch(1);
+final Pointer ex = new Pointer<>();
+final String controls = Controls.newBuilder()
+  .addTimedPause(DummyClass.class, DummyClass.PAUSES, 0, pauseDuration)
+  .build();
+
+ControlsInjectionUtil.setControls(session, controls);
+
+final QueryContext queryContext = new QueryContext(session, 
bits[0].getContext(), QueryId.getDefaultInstance());
+//We don't need a ResumingThread because this should automatically 
resume
+
+// test that the pause happens
+final DummyClass dummyClass = new DummyClass(queryContext, trigger);
+final long actualDuration = dummyClass.pauses();
+assertTrue(String.format("Test should stop for at least %d 
milliseconds.", expectedDuration),
+  expectedDuration <= actualDuration);
+assertTrue("No exception should be thrown.", ex.value == null);
+try {
+  queryContext.close();
+} catch (final Exception e) {
+  fail("Failed to close query context: " + e);
--- End diff --

maybe better let JUnit handle unexpected expection (at least you would get 
the whole stack trace instead of just the error message) (I guess it's not new 
code, so feel free to ignore)


> Support injection of time-bound pauses in server
> 
>
> Key: DRILL-5973
> URL: https://issues.apache.org/jira/browse/DRILL-5973
> Project: Apache Drill
>  Issue Type: Improvement
>  Components: Tools, Build & Test
>Affects Versions: 1.11.0
>Reporter: Kunal Khatua
>Assignee: Kunal Khatua
> Fix For: 1.13.0
>
>
> While working on DRILL-3640 , when creating a unit test for a server-induced 
> timeout, the injecting a pause leaves the JUnit framework's DrillClient 
> without a handle to the query on the server. This is because we injected the 
> pause to occur before the server could send back a query ID, so the 
> DrillClient has no way to unpause the server.
> The workaround to support this unit test is to allow for injecting pauses 
> with a defined time-bound, after which the server would resume.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (DRILL-5973) Support injection of time-bound pauses in server

2017-11-30 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-5973?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16273796#comment-16273796
 ] 

ASF GitHub Bot commented on DRILL-5973:
---

Github user kkhatua commented on a diff in the pull request:

https://github.com/apache/drill/pull/1055#discussion_r154248904
  
--- Diff: 
exec/java-exec/src/test/java/org/apache/drill/exec/testing/TestPauseInjection.java
 ---
@@ -144,6 +144,34 @@ public void pauseInjected() {
 }
   }
 
+  @Test
+  public void timedPauseInjected() {
+final long pauseDuration = 2000L;
+final long expectedDuration = pauseDuration;
+final ExtendedLatch trigger = new ExtendedLatch(1);
+final Pointer ex = new Pointer<>();
+final String controls = Controls.newBuilder()
+  .addTimedPause(DummyClass.class, DummyClass.PAUSES, 0, pauseDuration)
+  .build();
+
+ControlsInjectionUtil.setControls(session, controls);
+
+final QueryContext queryContext = new QueryContext(session, 
bits[0].getContext(), QueryId.getDefaultInstance());
+//We don't need a ResumingThread because this should automatically 
resume
+
+// test that the pause happens
+final DummyClass dummyClass = new DummyClass(queryContext, trigger);
+final long actualDuration = dummyClass.pauses();
+assertTrue(String.format("Test should stop for at least %d 
milliseconds.", expectedDuration),
+  expectedDuration <= actualDuration);
+assertTrue("No exception should be thrown.", ex.value == null);
+try {
+  queryContext.close();
+} catch (final Exception e) {
+  fail("Failed to close query context: " + e);
--- End diff --

```
did you forget to remove that part following up on your other change?
```
Didn't forget to remove. It drives the logger to publish the message in the 
debugger as time-bound if it is non-zero.


> Support injection of time-bound pauses in server
> 
>
> Key: DRILL-5973
> URL: https://issues.apache.org/jira/browse/DRILL-5973
> Project: Apache Drill
>  Issue Type: Improvement
>  Components: Tools, Build & Test
>Affects Versions: 1.11.0
>Reporter: Kunal Khatua
>Assignee: Kunal Khatua
> Fix For: 1.13.0
>
>
> While working on DRILL-3640 , when creating a unit test for a server-induced 
> timeout, the injecting a pause leaves the JUnit framework's DrillClient 
> without a handle to the query on the server. This is because we injected the 
> pause to occur before the server could send back a query ID, so the 
> DrillClient has no way to unpause the server.
> The workaround to support this unit test is to allow for injecting pauses 
> with a defined time-bound, after which the server would resume.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (DRILL-5973) Support injection of time-bound pauses in server

2017-11-30 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-5973?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16273822#comment-16273822
 ] 

ASF GitHub Bot commented on DRILL-5973:
---

Github user kkhatua commented on the issue:

https://github.com/apache/drill/pull/1055
  
Verified the PauseInjection tests and that the commit builds and works 
normally.


> Support injection of time-bound pauses in server
> 
>
> Key: DRILL-5973
> URL: https://issues.apache.org/jira/browse/DRILL-5973
> Project: Apache Drill
>  Issue Type: Improvement
>  Components: Tools, Build & Test
>Affects Versions: 1.11.0
>Reporter: Kunal Khatua
>Assignee: Kunal Khatua
> Fix For: 1.13.0
>
>
> While working on DRILL-3640 , when creating a unit test for a server-induced 
> timeout, the injecting a pause leaves the JUnit framework's DrillClient 
> without a handle to the query on the server. This is because we injected the 
> pause to occur before the server could send back a query ID, so the 
> DrillClient has no way to unpause the server.
> The workaround to support this unit test is to allow for injecting pauses 
> with a defined time-bound, after which the server would resume.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (DRILL-5973) Support injection of time-bound pauses in server

2017-11-30 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-5973?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16273802#comment-16273802
 ] 

ASF GitHub Bot commented on DRILL-5973:
---

Github user kkhatua commented on the issue:

https://github.com/apache/drill/pull/1055
  
Sorry. Pushing in changes and squashing simultaneously. Made the relevant 
changes, except for the check 
```
  long pauseDuration = pauseInjection.getMsPause();
  if ( pauseDuration > 0L) {
```


> Support injection of time-bound pauses in server
> 
>
> Key: DRILL-5973
> URL: https://issues.apache.org/jira/browse/DRILL-5973
> Project: Apache Drill
>  Issue Type: Improvement
>  Components: Tools, Build & Test
>Affects Versions: 1.11.0
>Reporter: Kunal Khatua
>Assignee: Kunal Khatua
> Fix For: 1.13.0
>
>
> While working on DRILL-3640 , when creating a unit test for a server-induced 
> timeout, the injecting a pause leaves the JUnit framework's DrillClient 
> without a handle to the query on the server. This is because we injected the 
> pause to occur before the server could send back a query ID, so the 
> DrillClient has no way to unpause the server.
> The workaround to support this unit test is to allow for injecting pauses 
> with a defined time-bound, after which the server would resume.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (DRILL-6000) Graceful Shutdown Unit Tests Should Not Be Run On Travis

2017-11-30 Thread Arina Ielchiieva (JIRA)

 [ 
https://issues.apache.org/jira/browse/DRILL-6000?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Arina Ielchiieva updated DRILL-6000:

Issue Type: Task  (was: Bug)

> Graceful Shutdown Unit Tests Should Not Be Run On Travis
> 
>
> Key: DRILL-6000
> URL: https://issues.apache.org/jira/browse/DRILL-6000
> Project: Apache Drill
>  Issue Type: Task
>Affects Versions: 1.12.0
>Reporter: Timothy Farkas
>Assignee: Timothy Farkas
>  Labels: ready-to-commit
> Fix For: 1.13.0
>
>
> Currently these tests fail on Travis. But since they are heavy weight tests 
> which test a corner case, they should not be run as part of the smoke tests.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (DRILL-6000) Graceful Shutdown Unit Tests Should Not Be Run On Travis

2017-11-30 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-6000?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16272574#comment-16272574
 ] 

ASF GitHub Bot commented on DRILL-6000:
---

Github user arina-ielchiieva commented on the issue:

https://github.com/apache/drill/pull/1056
  
+1, LGTM.


> Graceful Shutdown Unit Tests Should Not Be Run On Travis
> 
>
> Key: DRILL-6000
> URL: https://issues.apache.org/jira/browse/DRILL-6000
> Project: Apache Drill
>  Issue Type: Bug
>Affects Versions: 1.12.0
>Reporter: Timothy Farkas
>Assignee: Timothy Farkas
>  Labels: ready-to-commit
> Fix For: 1.13.0
>
>
> Currently these tests fail on Travis. But since they are heavy weight tests 
> which test a corner case, they should not be run as part of the smoke tests.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (DRILL-6000) Graceful Shutdown Unit Tests Should Not Be Run On Travis

2017-11-30 Thread Arina Ielchiieva (JIRA)

 [ 
https://issues.apache.org/jira/browse/DRILL-6000?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Arina Ielchiieva updated DRILL-6000:

Labels: ready-to-commit  (was: )

> Graceful Shutdown Unit Tests Should Not Be Run On Travis
> 
>
> Key: DRILL-6000
> URL: https://issues.apache.org/jira/browse/DRILL-6000
> Project: Apache Drill
>  Issue Type: Task
>Affects Versions: 1.12.0
>Reporter: Timothy Farkas
>Assignee: Timothy Farkas
>  Labels: ready-to-commit
> Fix For: 1.13.0
>
>
> Currently these tests fail on Travis. But since they are heavy weight tests 
> which test a corner case, they should not be run as part of the smoke tests.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (DRILL-6000) Graceful Shutdown Unit Tests Should Not Be Run On Travis

2017-11-30 Thread Arina Ielchiieva (JIRA)

 [ 
https://issues.apache.org/jira/browse/DRILL-6000?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Arina Ielchiieva updated DRILL-6000:

Fix Version/s: 1.13.0

> Graceful Shutdown Unit Tests Should Not Be Run On Travis
> 
>
> Key: DRILL-6000
> URL: https://issues.apache.org/jira/browse/DRILL-6000
> Project: Apache Drill
>  Issue Type: Bug
>Affects Versions: 1.12.0
>Reporter: Timothy Farkas
>Assignee: Timothy Farkas
>  Labels: ready-to-commit
> Fix For: 1.13.0
>
>
> Currently these tests fail on Travis. But since they are heavy weight tests 
> which test a corner case, they should not be run as part of the smoke tests.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (DRILL-6000) Graceful Shutdown Unit Tests Should Not Be Run On Travis

2017-11-30 Thread Arina Ielchiieva (JIRA)

 [ 
https://issues.apache.org/jira/browse/DRILL-6000?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Arina Ielchiieva updated DRILL-6000:

Affects Version/s: 1.12.0

> Graceful Shutdown Unit Tests Should Not Be Run On Travis
> 
>
> Key: DRILL-6000
> URL: https://issues.apache.org/jira/browse/DRILL-6000
> Project: Apache Drill
>  Issue Type: Bug
>Affects Versions: 1.12.0
>Reporter: Timothy Farkas
>Assignee: Timothy Farkas
>  Labels: ready-to-commit
> Fix For: 1.13.0
>
>
> Currently these tests fail on Travis. But since they are heavy weight tests 
> which test a corner case, they should not be run as part of the smoke tests.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)