[jira] [Commented] (DRILL-5196) Could not run a single MongoDB unit test case through command line or IDE

2017-03-28 Thread Kunal Khatua (JIRA)

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

Kunal Khatua commented on DRILL-5196:
-

QA verification is not needed as added unit tests confirm the fix.

> Could not run a single MongoDB unit test case through command line or IDE
> -
>
> Key: DRILL-5196
> URL: https://issues.apache.org/jira/browse/DRILL-5196
> Project: Apache Drill
>  Issue Type: Bug
>Reporter: Chunhui Shi
>Assignee: Chunhui Shi
>  Labels: ready-to-commit
> Fix For: 1.10.0
>
>
> Could not run a single MongoDB's unit test through IDE or command line. The 
> reason is when running a single test case, the MongoDB instance did not get 
> started thus a 'table not found' error for 'mongo.employee.empinfo' would be 
> raised.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (DRILL-5196) Could not run a single MongoDB unit test case through command line or IDE

2017-02-24 Thread ASF GitHub Bot (JIRA)

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

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

Github user asfgit closed the pull request at:

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


> Could not run a single MongoDB unit test case through command line or IDE
> -
>
> Key: DRILL-5196
> URL: https://issues.apache.org/jira/browse/DRILL-5196
> Project: Apache Drill
>  Issue Type: Bug
>Reporter: Chunhui Shi
>Assignee: Chunhui Shi
>  Labels: ready-to-commit
>
> Could not run a single MongoDB's unit test through IDE or command line. The 
> reason is when running a single test case, the MongoDB instance did not get 
> started thus a 'table not found' error for 'mongo.employee.empinfo' would be 
> raised.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (DRILL-5196) Could not run a single MongoDB unit test case through command line or IDE

2017-02-24 Thread ASF GitHub Bot (JIRA)

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

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

Github user sudheeshkatkam commented on the issue:

https://github.com/apache/drill/pull/741
  
+1


> Could not run a single MongoDB unit test case through command line or IDE
> -
>
> Key: DRILL-5196
> URL: https://issues.apache.org/jira/browse/DRILL-5196
> Project: Apache Drill
>  Issue Type: Bug
>Reporter: Chunhui Shi
>Assignee: Chunhui Shi
>  Labels: ready-to-commit
>
> Could not run a single MongoDB's unit test through IDE or command line. The 
> reason is when running a single test case, the MongoDB instance did not get 
> started thus a 'table not found' error for 'mongo.employee.empinfo' would be 
> raised.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (DRILL-5196) Could not run a single MongoDB unit test case through command line or IDE

2017-02-24 Thread ASF GitHub Bot (JIRA)

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

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

Github user gparai commented on the issue:

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


> Could not run a single MongoDB unit test case through command line or IDE
> -
>
> Key: DRILL-5196
> URL: https://issues.apache.org/jira/browse/DRILL-5196
> Project: Apache Drill
>  Issue Type: Bug
>Reporter: Chunhui Shi
>Assignee: Chunhui Shi
>
> Could not run a single MongoDB's unit test through IDE or command line. The 
> reason is when running a single test case, the MongoDB instance did not get 
> started thus a 'table not found' error for 'mongo.employee.empinfo' would be 
> raised.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (DRILL-5196) Could not run a single MongoDB unit test case through command line or IDE

2017-02-04 Thread ASF GitHub Bot (JIRA)

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

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

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

https://github.com/apache/drill/pull/741#discussion_r99470619
  
--- Diff: contrib/storage-mongo/src/test/resources/datatype.json ---
@@ -0,0 +1 @@
+[{"_id": {"$oid" : "582081d96b69060001fd8938"}, "account" : { "$ref": 
"contact", "$id": {"$oid": "999cbf116b69060001fd8611"} }}, {"_id" : {"$oid" : 
"582081d96b69060001fd8939" } } ]
--- End diff --

Should we rename it to something like datatype_dbref.json? The name seems 
to suggest we have all datatypes in this document


> Could not run a single MongoDB unit test case through command line or IDE
> -
>
> Key: DRILL-5196
> URL: https://issues.apache.org/jira/browse/DRILL-5196
> Project: Apache Drill
>  Issue Type: Bug
>Reporter: Chunhui Shi
>Assignee: Chunhui Shi
>
> Could not run a single MongoDB's unit test through IDE or command line. The 
> reason is when running a single test case, the MongoDB instance did not get 
> started thus a 'table not found' error for 'mongo.employee.empinfo' would be 
> raised.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (DRILL-5196) Could not run a single MongoDB unit test case through command line or IDE

2017-02-04 Thread ASF GitHub Bot (JIRA)

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

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

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

https://github.com/apache/drill/pull/741#discussion_r99470421
  
--- Diff: 
contrib/storage-mongo/src/test/java/org/apache/drill/exec/store/mongo/TestTableGenerator.java
 ---
@@ -58,7 +59,12 @@ public static void generateTable(String dbName, String 
collection,
 .jsonArray(jsonArray).importFile(jsonFile).build();
 MongoImportExecutable importExecutable = MongoImportStarter
 .getDefaultInstance().prepare(mongoImportConfig);
-importExecutable.start();
+MongoImportProcess importProcess = importExecutable.start();
+
+while (importProcess.isProcessRunning()) {
--- End diff --

Please add a comment explaining the change - Import process is running in a 
different thread/process and we do not to start running any test prior to 
import complete?


> Could not run a single MongoDB unit test case through command line or IDE
> -
>
> Key: DRILL-5196
> URL: https://issues.apache.org/jira/browse/DRILL-5196
> Project: Apache Drill
>  Issue Type: Bug
>Reporter: Chunhui Shi
>Assignee: Chunhui Shi
>
> Could not run a single MongoDB's unit test through IDE or command line. The 
> reason is when running a single test case, the MongoDB instance did not get 
> started thus a 'table not found' error for 'mongo.employee.empinfo' would be 
> raised.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (DRILL-5196) Could not run a single MongoDB unit test case through command line or IDE

2017-02-03 Thread ASF GitHub Bot (JIRA)

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

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

Github user chunhui-shi commented on a diff in the pull request:

https://github.com/apache/drill/pull/741#discussion_r99455997
  
--- Diff: 
contrib/storage-mongo/src/test/java/org/apache/drill/exec/store/mongo/MongoTestSuit.java
 ---
@@ -204,16 +209,20 @@ private static void cleanup() {
   @BeforeClass
   public static void initMongo() throws Exception {
 synchronized (MongoTestSuit.class) {
-  if (distMode) {
-logger.info("Executing tests in distributed mode");
-DistributedMode.setup();
-  } else {
-logger.info("Executing tests in single mode");
-SingleMode.setup();
+  if (initCount.get() == 0) {
--- End diff --

Then it will increase the count when the init is not done. If init fail in 
the middle, then another test has no chance to try.


> Could not run a single MongoDB unit test case through command line or IDE
> -
>
> Key: DRILL-5196
> URL: https://issues.apache.org/jira/browse/DRILL-5196
> Project: Apache Drill
>  Issue Type: Bug
>Reporter: Chunhui Shi
>Assignee: Chunhui Shi
>
> Could not run a single MongoDB's unit test through IDE or command line. The 
> reason is when running a single test case, the MongoDB instance did not get 
> started thus a 'table not found' error for 'mongo.employee.empinfo' would be 
> raised.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (DRILL-5196) Could not run a single MongoDB unit test case through command line or IDE

2017-02-03 Thread ASF GitHub Bot (JIRA)

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

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

Github user chunhui-shi commented on a diff in the pull request:

https://github.com/apache/drill/pull/741#discussion_r99453293
  
--- Diff: 
contrib/storage-mongo/src/test/java/org/apache/drill/exec/store/mongo/MongoTestSuit.java
 ---
@@ -234,15 +243,25 @@ private static void createDbAndCollections(String 
dbName,
 
   @AfterClass
   public static void tearDownCluster() throws Exception {
-if (mongoClient != null) {
-  mongoClient.dropDatabase(EMPLOYEE_DB);
-  mongoClient.close();
-}
 synchronized (MongoTestSuit.class) {
-  if (distMode) {
-DistributedMode.cleanup();
-  } else {
-SingleMode.cleanup();
+  if (initCount.decrementAndGet() == 0) {
+try {
+  if (mongoClient != null) {
--- End diff --

Then we will end up not to cleanup the cluster if mongoClient for some 
reason was set to null? I think it is better leave it as is.


> Could not run a single MongoDB unit test case through command line or IDE
> -
>
> Key: DRILL-5196
> URL: https://issues.apache.org/jira/browse/DRILL-5196
> Project: Apache Drill
>  Issue Type: Bug
>Reporter: Chunhui Shi
>Assignee: Chunhui Shi
>
> Could not run a single MongoDB's unit test through IDE or command line. The 
> reason is when running a single test case, the MongoDB instance did not get 
> started thus a 'table not found' error for 'mongo.employee.empinfo' would be 
> raised.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (DRILL-5196) Could not run a single MongoDB unit test case through command line or IDE

2017-02-03 Thread ASF GitHub Bot (JIRA)

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

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

Github user chunhui-shi commented on a diff in the pull request:

https://github.com/apache/drill/pull/741#discussion_r99452939
  
--- Diff: 
contrib/storage-mongo/src/test/java/org/apache/drill/exec/store/mongo/MongoTestSuit.java
 ---
@@ -234,15 +243,25 @@ private static void createDbAndCollections(String 
dbName,
 
   @AfterClass
   public static void tearDownCluster() throws Exception {
-if (mongoClient != null) {
-  mongoClient.dropDatabase(EMPLOYEE_DB);
-  mongoClient.close();
-}
 synchronized (MongoTestSuit.class) {
-  if (distMode) {
-DistributedMode.cleanup();
-  } else {
-SingleMode.cleanup();
+  if (initCount.decrementAndGet() == 0) {
--- End diff --

Without Synchronized, there is still chance two threads go into this place. 
while thread 0 go to here and is in the middle of tearing down cluster, then 
thread 1 increases initCount to 1 and somehow report error then come to here to 
decrease initCount and continue... Then we don't know what will happen.


> Could not run a single MongoDB unit test case through command line or IDE
> -
>
> Key: DRILL-5196
> URL: https://issues.apache.org/jira/browse/DRILL-5196
> Project: Apache Drill
>  Issue Type: Bug
>Reporter: Chunhui Shi
>Assignee: Chunhui Shi
>
> Could not run a single MongoDB's unit test through IDE or command line. The 
> reason is when running a single test case, the MongoDB instance did not get 
> started thus a 'table not found' error for 'mongo.employee.empinfo' would be 
> raised.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (DRILL-5196) Could not run a single MongoDB unit test case through command line or IDE

2017-02-03 Thread ASF GitHub Bot (JIRA)

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

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

Github user paul-rogers commented on a diff in the pull request:

https://github.com/apache/drill/pull/741#discussion_r99451363
  
--- Diff: 
contrib/storage-mongo/src/test/java/org/apache/drill/exec/store/mongo/MongoTestSuit.java
 ---
@@ -204,16 +209,20 @@ private static void cleanup() {
   @BeforeClass
   public static void initMongo() throws Exception {
 synchronized (MongoTestSuit.class) {
-  if (distMode) {
-logger.info("Executing tests in distributed mode");
-DistributedMode.setup();
-  } else {
-logger.info("Executing tests in single mode");
-SingleMode.setup();
+  if (initCount.get() == 0) {
--- End diff --

non-synchronized and if (initCount.getAndIncrement() == 0) ?


> Could not run a single MongoDB unit test case through command line or IDE
> -
>
> Key: DRILL-5196
> URL: https://issues.apache.org/jira/browse/DRILL-5196
> Project: Apache Drill
>  Issue Type: Bug
>Reporter: Chunhui Shi
>Assignee: Chunhui Shi
>
> Could not run a single MongoDB's unit test through IDE or command line. The 
> reason is when running a single test case, the MongoDB instance did not get 
> started thus a 'table not found' error for 'mongo.employee.empinfo' would be 
> raised.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (DRILL-5196) Could not run a single MongoDB unit test case through command line or IDE

2017-02-03 Thread ASF GitHub Bot (JIRA)

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

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

Github user paul-rogers commented on a diff in the pull request:

https://github.com/apache/drill/pull/741#discussion_r99451485
  
--- Diff: 
contrib/storage-mongo/src/test/java/org/apache/drill/exec/store/mongo/MongoTestSuit.java
 ---
@@ -234,15 +243,25 @@ private static void createDbAndCollections(String 
dbName,
 
   @AfterClass
   public static void tearDownCluster() throws Exception {
-if (mongoClient != null) {
-  mongoClient.dropDatabase(EMPLOYEE_DB);
-  mongoClient.close();
-}
 synchronized (MongoTestSuit.class) {
-  if (distMode) {
-DistributedMode.cleanup();
-  } else {
-SingleMode.cleanup();
+  if (initCount.decrementAndGet() == 0) {
+try {
+  if (mongoClient != null) {
--- End diff --

Move to top of function?
```
if (mongoClient==null) { return; }
if (initCount.decrementAndGet() == 0) { ...
```


> Could not run a single MongoDB unit test case through command line or IDE
> -
>
> Key: DRILL-5196
> URL: https://issues.apache.org/jira/browse/DRILL-5196
> Project: Apache Drill
>  Issue Type: Bug
>Reporter: Chunhui Shi
>Assignee: Chunhui Shi
>
> Could not run a single MongoDB's unit test through IDE or command line. The 
> reason is when running a single test case, the MongoDB instance did not get 
> started thus a 'table not found' error for 'mongo.employee.empinfo' would be 
> raised.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (DRILL-5196) Could not run a single MongoDB unit test case through command line or IDE

2017-02-03 Thread ASF GitHub Bot (JIRA)

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

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

Github user paul-rogers commented on a diff in the pull request:

https://github.com/apache/drill/pull/741#discussion_r99451419
  
--- Diff: 
contrib/storage-mongo/src/test/java/org/apache/drill/exec/store/mongo/MongoTestSuit.java
 ---
@@ -234,15 +243,25 @@ private static void createDbAndCollections(String 
dbName,
 
   @AfterClass
   public static void tearDownCluster() throws Exception {
-if (mongoClient != null) {
-  mongoClient.dropDatabase(EMPLOYEE_DB);
-  mongoClient.close();
-}
 synchronized (MongoTestSuit.class) {
-  if (distMode) {
-DistributedMode.cleanup();
-  } else {
-SingleMode.cleanup();
+  if (initCount.decrementAndGet() == 0) {
--- End diff --

Because using the atomic int, also need the synchronized?


> Could not run a single MongoDB unit test case through command line or IDE
> -
>
> Key: DRILL-5196
> URL: https://issues.apache.org/jira/browse/DRILL-5196
> Project: Apache Drill
>  Issue Type: Bug
>Reporter: Chunhui Shi
>Assignee: Chunhui Shi
>
> Could not run a single MongoDB's unit test through IDE or command line. The 
> reason is when running a single test case, the MongoDB instance did not get 
> started thus a 'table not found' error for 'mongo.employee.empinfo' would be 
> raised.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (DRILL-5196) Could not run a single MongoDB unit test case through command line or IDE

2017-02-03 Thread ASF GitHub Bot (JIRA)

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

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

GitHub user chunhui-shi opened a pull request:

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

DRILL-5196: init MongoDB cluster when run a single test case directly…

… through command line or IDE.

Other fixes include:
Sync mongo-java-driver versions to newer 3.2.0
update flapdoodle package to latest accordingly

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

$ git pull https://github.com/chunhui-shi/drill DRILL-5196

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

https://github.com/apache/drill/pull/741.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 #741


commit 6068d7a21a0cf45ba9f5f3c76ad48dbd94c6e204
Author: chunhui-shi 
Date:   2017-01-14T01:20:46Z

DRILL-5196: init MongoDB cluster when run a single test case directly 
through command line or IDE.
Other fixes include:
Sync mongo-java-driver versions to newer 3.2.0
update flapdoodle package to latest accordingly




> Could not run a single MongoDB unit test case through command line or IDE
> -
>
> Key: DRILL-5196
> URL: https://issues.apache.org/jira/browse/DRILL-5196
> Project: Apache Drill
>  Issue Type: Bug
>Reporter: Chunhui Shi
>Assignee: Chunhui Shi
>
> Could not run a single MongoDB's unit test through IDE or command line. The 
> reason is when running a single test case, the MongoDB instance did not get 
> started thus a 'table not found' error for 'mongo.employee.empinfo' would be 
> raised.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (DRILL-5196) Could not run a single MongoDB unit test case through command line or IDE

2017-02-03 Thread ASF GitHub Bot (JIRA)

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

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

Github user chunhui-shi closed the pull request at:

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


> Could not run a single MongoDB unit test case through command line or IDE
> -
>
> Key: DRILL-5196
> URL: https://issues.apache.org/jira/browse/DRILL-5196
> Project: Apache Drill
>  Issue Type: Bug
>Reporter: Chunhui Shi
>Assignee: Chunhui Shi
>
> Could not run a single MongoDB's unit test through IDE or command line. The 
> reason is when running a single test case, the MongoDB instance did not get 
> started thus a 'table not found' error for 'mongo.employee.empinfo' would be 
> raised.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (DRILL-5196) Could not run a single MongoDB unit test case through command line or IDE

2017-01-16 Thread ASF GitHub Bot (JIRA)

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

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

GitHub user chunhui-shi opened a pull request:

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

DRILL-5196: init MongoDB cluster when run a single test case directly…

… through command line or IDE.

Other fixes include:
Sync mongo-java-driver versions to newer 3.2.0
update flapdoodle package to latest accordingly

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

$ git pull https://github.com/chunhui-shi/drill DRILL-5196

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

https://github.com/apache/drill/pull/722.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 #722


commit 67d6488975e4c0a66977a16feeb23abb476b480d
Author: chunhui-shi 
Date:   2017-01-14T01:20:46Z

DRILL-5196: init MongoDB cluster when run a single test case directly 
through command line or IDE.
Other fixes include:
Sync mongo-java-driver versions to newer 3.2.0
update flapdoodle package to latest accordingly




> Could not run a single MongoDB unit test case through command line or IDE
> -
>
> Key: DRILL-5196
> URL: https://issues.apache.org/jira/browse/DRILL-5196
> Project: Apache Drill
>  Issue Type: Bug
>Reporter: Chunhui Shi
>Assignee: Chunhui Shi
>
> Could not run a single MongoDB's unit test through IDE or command line. The 
> reason is when running a single test case, the MongoDB instance did not get 
> started thus a 'table not found' error for 'mongo.employee.empinfo' would be 
> raised.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)