You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/01/06 05:19:18 UTC

[GitHub] [shardingsphere] takuya1981 opened a new pull request #14561: Add test cases for DataSourceDestroyer for #14039

takuya1981 opened a new pull request #14561:
URL: https://github.com/apache/shardingsphere/pull/14561


   It's for #14039.
   
   Files added in this pull request:
   - DefaultDataSourcePoolDestroyerTest 
   - DataSourcePoolDestroyerFactoryTest
   - HikariDataSourcePoolDestroyerTest
   


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

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] takuya1981 commented on a change in pull request #14561: Add test cases for DataSourceDestroyer for #14039

Posted by GitBox <gi...@apache.org>.
takuya1981 commented on a change in pull request #14561:
URL: https://github.com/apache/shardingsphere/pull/14561#discussion_r779944040



##########
File path: shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/config/datasource/pool/destroyer/DataSourcePoolDestroyerFactoryTest.java
##########
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.infra.config.datasource.pool.destroyer;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.fail;
+
+import java.sql.SQLException;
+
+import com.zaxxer.hikari.HikariDataSource;
+
+import org.apache.commons.dbcp2.BasicDataSource;
+import org.junit.Test;
+
+public final class DataSourcePoolDestroyerFactoryTest {
+    
+    @Test
+    public void assertDestroyForHikari() throws InterruptedException {
+        try {
+            HikariDataSource dataSource = new HikariDataSource();
+            DataSourcePoolDestroyerFactory.destroy(dataSource);
+            Thread.sleep(10L);
+            assertThat(dataSource.isClosed(), is(true));

Review comment:
       I understand.
   I fixed to use while statement and set timeout for test method.




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

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] takuya1981 commented on pull request #14561: Add test cases for DataSourceDestroyer for #14039

Posted by GitBox <gi...@apache.org>.
takuya1981 commented on pull request #14561:
URL: https://github.com/apache/shardingsphere/pull/14561#issuecomment-1021753969


   @terrymanu ,
   Thank you for your comment. I fixed. Can you confirm?


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

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] terrymanu commented on a change in pull request #14561: Add test cases for DataSourceDestroyer for #14039

Posted by GitBox <gi...@apache.org>.
terrymanu commented on a change in pull request #14561:
URL: https://github.com/apache/shardingsphere/pull/14561#discussion_r795227424



##########
File path: shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/datasource/pool/destroyer/impl/HikariDataSourcePoolDestroyerTest.java
##########
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.infra.datasource.pool.destroyer.impl;
+
+import com.zaxxer.hikari.HikariDataSource;
+
+import org.junit.Test;
+
+public final class HikariDataSourcePoolDestroyerTest {
+
+    @Test(timeout = 60000L)
+    public void assertDestroy() throws InterruptedException {
+        HikariDataSource dataSource = new HikariDataSource();
+        new HikariDataSourcePoolDestroyer().destroy(dataSource);
+        while (!dataSource.isClosed()) {
+            Thread.sleep(10L);
+        }

Review comment:
       Do we need an assertion for check close data source here?




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

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] takuya1981 commented on pull request #14561: Add test cases for DataSourceDestroyer for #14039

Posted by GitBox <gi...@apache.org>.
takuya1981 commented on pull request #14561:
URL: https://github.com/apache/shardingsphere/pull/14561#issuecomment-1021816766


   It seems merging master is needed. I'll fix it.


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

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] terrymanu commented on pull request #14561: Add test cases for DataSourceDestroyer for #14039

Posted by GitBox <gi...@apache.org>.
terrymanu commented on pull request #14561:
URL: https://github.com/apache/shardingsphere/pull/14561#issuecomment-1025202466


   Thank you, I will merge soon


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

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] terrymanu commented on a change in pull request #14561: Add test cases for DataSourceDestroyer for #14039

Posted by GitBox <gi...@apache.org>.
terrymanu commented on a change in pull request #14561:
URL: https://github.com/apache/shardingsphere/pull/14561#discussion_r795227858



##########
File path: shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/datasource/pool/destroyer/impl/HikariDataSourcePoolDestroyerTest.java
##########
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.infra.datasource.pool.destroyer.impl;
+
+import com.zaxxer.hikari.HikariDataSource;
+
+import org.junit.Test;
+
+public final class HikariDataSourcePoolDestroyerTest {
+
+    @Test(timeout = 60000L)
+    public void assertDestroy() throws InterruptedException {
+        HikariDataSource dataSource = new HikariDataSource();
+        new HikariDataSourcePoolDestroyer().destroy(dataSource);
+        while (!dataSource.isClosed()) {
+            Thread.sleep(10L);
+        }

Review comment:
       The assertion has already in the while judge, I just resolve it




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

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] terrymanu commented on a change in pull request #14561: Add test cases for DataSourceDestroyer for #14039

Posted by GitBox <gi...@apache.org>.
terrymanu commented on a change in pull request #14561:
URL: https://github.com/apache/shardingsphere/pull/14561#discussion_r779482869



##########
File path: shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/config/datasource/pool/destroyer/DataSourcePoolDestroyerFactoryTest.java
##########
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.infra.config.datasource.pool.destroyer;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.fail;
+
+import java.sql.SQLException;
+
+import com.zaxxer.hikari.HikariDataSource;
+
+import org.apache.commons.dbcp2.BasicDataSource;
+import org.junit.Test;
+
+public final class DataSourcePoolDestroyerFactoryTest {
+    
+    @Test
+    public void assertDestroyForHikari() throws InterruptedException {
+        try {
+            HikariDataSource dataSource = new HikariDataSource();
+            DataSourcePoolDestroyerFactory.destroy(dataSource);
+            Thread.sleep(10L);
+            assertThat(dataSource.isClosed(), is(true));

Review comment:
       It can not make sure the data source is closed.
   How about use `while(dataSource.isClosed()) {xxx}` to assert the test case?




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

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] codecov-commenter commented on pull request #14561: Add test cases for DataSourceDestroyer for #14039

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #14561:
URL: https://github.com/apache/shardingsphere/pull/14561#issuecomment-1006367949


   # [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/14561?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#14561](https://codecov.io/gh/apache/shardingsphere/pull/14561?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (74e02af) into [master](https://codecov.io/gh/apache/shardingsphere/commit/1e6d7ca09aaaca458ecceae66f8c6b4b9e63f0fe?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (1e6d7ca) will **increase** coverage by `0.01%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/shardingsphere/pull/14561/graphs/tree.svg?width=650&height=150&src=pr&token=ZvlXpWa7so&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/shardingsphere/pull/14561?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master   #14561      +/-   ##
   ============================================
   + Coverage     59.88%   59.90%   +0.01%     
   - Complexity     1823     1825       +2     
   ============================================
     Files          3010     3011       +1     
     Lines         44704    44746      +42     
     Branches       7590     7589       -1     
   ============================================
   + Hits          26773    26807      +34     
   - Misses        15841    15847       +6     
   - Partials       2090     2092       +2     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/14561?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...e/shardingsphere/infra/instance/utils/IpUtils.java](https://codecov.io/gh/apache/shardingsphere/pull/14561/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9pbmZyYS9pbnN0YW5jZS91dGlscy9JcFV0aWxzLmphdmE=) | `60.00% <0.00%> (-8.00%)` | :arrow_down: |
   | [.../mode/metadata/persist/MetaDataPersistService.java](https://codecov.io/gh/apache/shardingsphere/pull/14561/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtbW9kZS9zaGFyZGluZ3NwaGVyZS1tb2RlLWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL21vZGUvbWV0YWRhdGEvcGVyc2lzdC9NZXRhRGF0YVBlcnNpc3RTZXJ2aWNlLmphdmE=) | `60.71% <0.00%> (-2.25%)` | :arrow_down: |
   | [...sphere/proxy/initializer/BootstrapInitializer.java](https://codecov.io/gh/apache/shardingsphere/pull/14561/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtcHJveHkvc2hhcmRpbmdzcGhlcmUtcHJveHktYm9vdHN0cmFwL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9wcm94eS9pbml0aWFsaXplci9Cb290c3RyYXBJbml0aWFsaXplci5qYXZh) | `0.00% <0.00%> (ø)` | |
   | [...jdbc/core/datasource/ShardingSphereDataSource.java](https://codecov.io/gh/apache/shardingsphere/pull/14561/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtamRiYy9zaGFyZGluZ3NwaGVyZS1qZGJjLWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2RyaXZlci9qZGJjL2NvcmUvZGF0YXNvdXJjZS9TaGFyZGluZ1NwaGVyZURhdGFTb3VyY2UuamF2YQ==) | `94.59% <0.00%> (ø)` | |
   | [...ata/persist/service/ComputeNodePersistService.java](https://codecov.io/gh/apache/shardingsphere/pull/14561/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtbW9kZS9zaGFyZGluZ3NwaGVyZS1tb2RlLWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL21vZGUvbWV0YWRhdGEvcGVyc2lzdC9zZXJ2aWNlL0NvbXB1dGVOb2RlUGVyc2lzdFNlcnZpY2UuamF2YQ==) | `0.00% <0.00%> (ø)` | |
   | [...ere/traffic/executor/jdbc/JDBCTrafficExecutor.java](https://codecov.io/gh/apache/shardingsphere/pull/14561/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUta2VybmVsL3NoYXJkaW5nc3BoZXJlLXRyYWZmaWMvc2hhcmRpbmdzcGhlcmUtdHJhZmZpYy1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS90cmFmZmljL2V4ZWN1dG9yL2pkYmMvSkRCQ1RyYWZmaWNFeGVjdXRvci5qYXZh) | `0.00% <0.00%> (ø)` | |
   | [.../schedule/core/api/ModeScheduleContextFactory.java](https://codecov.io/gh/apache/shardingsphere/pull/14561/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUta2VybmVsL3NoYXJkaW5nc3BoZXJlLXNjaGVkdWxlL3NoYXJkaW5nc3BoZXJlLXNjaGVkdWxlLWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL3NjaGVkdWxlL2NvcmUvYXBpL01vZGVTY2hlZHVsZUNvbnRleHRGYWN0b3J5LmphdmE=) | `0.00% <0.00%> (ø)` | |
   | [...ral/common/show/executor/ShowInstanceExecutor.java](https://codecov.io/gh/apache/shardingsphere/pull/14561/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtcHJveHkvc2hhcmRpbmdzcGhlcmUtcHJveHktYmFja2VuZC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvcHJveHkvYmFja2VuZC90ZXh0L2Rpc3RzcWwvcmFsL2NvbW1vbi9zaG93L2V4ZWN1dG9yL1Nob3dJbnN0YW5jZUV4ZWN1dG9yLmphdmE=) | `0.00% <0.00%> (ø)` | |
   | [...de/manager/cluster/coordinator/RegistryCenter.java](https://codecov.io/gh/apache/shardingsphere/pull/14561/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtbW9kZS9zaGFyZGluZ3NwaGVyZS1tb2RlLXR5cGUvc2hhcmRpbmdzcGhlcmUtY2x1c3Rlci1tb2RlL3NoYXJkaW5nc3BoZXJlLWNsdXN0ZXItbW9kZS1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9tb2RlL21hbmFnZXIvY2x1c3Rlci9jb29yZGluYXRvci9SZWdpc3RyeUNlbnRlci5qYXZh) | `100.00% <0.00%> (ø)` | |
   | [.../coordinator/lock/service/LockRegistryService.java](https://codecov.io/gh/apache/shardingsphere/pull/14561/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtbW9kZS9zaGFyZGluZ3NwaGVyZS1tb2RlLXR5cGUvc2hhcmRpbmdzcGhlcmUtY2x1c3Rlci1tb2RlL3NoYXJkaW5nc3BoZXJlLWNsdXN0ZXItbW9kZS1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9tb2RlL21hbmFnZXIvY2x1c3Rlci9jb29yZGluYXRvci9sb2NrL3NlcnZpY2UvTG9ja1JlZ2lzdHJ5U2VydmljZS5qYXZh) | `37.14% <0.00%> (ø)` | |
   | ... and [8 more](https://codecov.io/gh/apache/shardingsphere/pull/14561/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/shardingsphere/pull/14561?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/14561?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [1e6d7ca...74e02af](https://codecov.io/gh/apache/shardingsphere/pull/14561?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


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

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] terrymanu commented on pull request #14561: Add test cases for DataSourceDestroyer for #14039

Posted by GitBox <gi...@apache.org>.
terrymanu commented on pull request #14561:
URL: https://github.com/apache/shardingsphere/pull/14561#issuecomment-1012754296


   The CI still broken, I just restart the job


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

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] terrymanu commented on a change in pull request #14561: Add test cases for DataSourceDestroyer for #14039

Posted by GitBox <gi...@apache.org>.
terrymanu commented on a change in pull request #14561:
URL: https://github.com/apache/shardingsphere/pull/14561#discussion_r790147176



##########
File path: shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/config/datasource/pool/destroyer/DataSourcePoolDestroyerFactoryTest.java
##########
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.infra.config.datasource.pool.destroyer;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.fail;
+
+import java.sql.SQLException;
+
+import com.zaxxer.hikari.HikariDataSource;
+
+import org.apache.commons.dbcp2.BasicDataSource;
+import org.junit.Test;
+
+public final class DataSourcePoolDestroyerFactoryTest {
+    
+    @Test(timeout = 60000)
+    public void assertDestroyForHikari() throws InterruptedException {
+        try {
+            HikariDataSource dataSource = new HikariDataSource();
+            DataSourcePoolDestroyerFactory.destroy(dataSource);
+            while (!dataSource.isClosed()) {
+                // Test will fail by timeout if dataSource is not closed.
+                Thread.sleep(10L);
+            }
+        } catch (SQLException ex) {
+            fail();

Review comment:
       Is it necessary to catch exception and assert fail here, how about throw SQLException in method signature?

##########
File path: shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/config/datasource/pool/destroyer/DataSourcePoolDestroyerFactoryTest.java
##########
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.infra.config.datasource.pool.destroyer;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.fail;
+
+import java.sql.SQLException;
+
+import com.zaxxer.hikari.HikariDataSource;
+
+import org.apache.commons.dbcp2.BasicDataSource;
+import org.junit.Test;
+
+public final class DataSourcePoolDestroyerFactoryTest {
+    
+    @Test(timeout = 60000)

Review comment:
       Please add `L` as suffix for long value

##########
File path: shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/config/datasource/pool/destroyer/impl/HikariDataSourcePoolDestroyerTest.java
##########
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.infra.config.datasource.pool.destroyer.impl;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertThat;
+
+import com.zaxxer.hikari.HikariDataSource;
+
+import org.junit.Test;
+
+public final class HikariDataSourcePoolDestroyerTest {
+
+    @Test(timeout = 60000)
+    public void assertDestroy() throws InterruptedException {
+        HikariDataSource dataSource = new HikariDataSource();
+        new HikariDataSourcePoolDestroyer().destroy(dataSource);
+        while (!dataSource.isClosed()) {
+            // Test will fail by timeout if dataSource is not closed.
+            Thread.sleep(10L);
+        }
+    }
+
+    @Test
+    public void assertGetType() {
+        assertThat(new HikariDataSourcePoolDestroyer().getType(), is(HikariDataSource.class.getCanonicalName()));
+    }

Review comment:
       There is unnecessary to assert static get method, could you remove this test case?

##########
File path: shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/config/datasource/pool/destroyer/impl/HikariDataSourcePoolDestroyerTest.java
##########
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.infra.config.datasource.pool.destroyer.impl;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertThat;
+
+import com.zaxxer.hikari.HikariDataSource;
+
+import org.junit.Test;
+
+public final class HikariDataSourcePoolDestroyerTest {
+
+    @Test(timeout = 60000)
+    public void assertDestroy() throws InterruptedException {
+        HikariDataSource dataSource = new HikariDataSource();
+        new HikariDataSourcePoolDestroyer().destroy(dataSource);
+        while (!dataSource.isClosed()) {
+            // Test will fail by timeout if dataSource is not closed.

Review comment:
       Could you remove the comment? I think the code has already explain all things.

##########
File path: shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/config/datasource/pool/destroyer/DataSourcePoolDestroyerFactoryTest.java
##########
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.infra.config.datasource.pool.destroyer;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.fail;
+
+import java.sql.SQLException;
+
+import com.zaxxer.hikari.HikariDataSource;
+
+import org.apache.commons.dbcp2.BasicDataSource;
+import org.junit.Test;
+
+public final class DataSourcePoolDestroyerFactoryTest {
+    
+    @Test(timeout = 60000)
+    public void assertDestroyForHikari() throws InterruptedException {
+        try {
+            HikariDataSource dataSource = new HikariDataSource();
+            DataSourcePoolDestroyerFactory.destroy(dataSource);
+            while (!dataSource.isClosed()) {
+                // Test will fail by timeout if dataSource is not closed.
+                Thread.sleep(10L);
+            }
+        } catch (SQLException ex) {
+            fail();
+        }
+    }
+
+    @Test
+    public void assertDestroyForDefault() throws InterruptedException {
+        try {
+            BasicDataSource dataSource = new BasicDataSource();
+            DataSourcePoolDestroyerFactory.destroy(dataSource);
+            assertThat(dataSource.isClosed(), is(true));
+        } catch (SQLException ex) {
+            fail();
+        }

Review comment:
       Is it necessary to catch exception and assert fail here, how about throw SQLException in method signature?

##########
File path: shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/config/datasource/pool/destroyer/DataSourcePoolDestroyerFactoryTest.java
##########
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.infra.config.datasource.pool.destroyer;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.fail;
+
+import java.sql.SQLException;
+
+import com.zaxxer.hikari.HikariDataSource;
+
+import org.apache.commons.dbcp2.BasicDataSource;
+import org.junit.Test;
+
+public final class DataSourcePoolDestroyerFactoryTest {
+    
+    @Test(timeout = 60000)
+    public void assertDestroyForHikari() throws InterruptedException {
+        try {
+            HikariDataSource dataSource = new HikariDataSource();
+            DataSourcePoolDestroyerFactory.destroy(dataSource);
+            while (!dataSource.isClosed()) {
+                // Test will fail by timeout if dataSource is not closed.
+                Thread.sleep(10L);
+            }
+        } catch (SQLException ex) {
+            fail();
+        }
+    }
+
+    @Test
+    public void assertDestroyForDefault() throws InterruptedException {
+        try {
+            BasicDataSource dataSource = new BasicDataSource();
+            DataSourcePoolDestroyerFactory.destroy(dataSource);
+            assertThat(dataSource.isClosed(), is(true));

Review comment:
       Please use assertTrue for unary assertion

##########
File path: shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/config/datasource/pool/destroyer/impl/HikariDataSourcePoolDestroyerTest.java
##########
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.infra.config.datasource.pool.destroyer.impl;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertThat;
+
+import com.zaxxer.hikari.HikariDataSource;
+
+import org.junit.Test;
+
+public final class HikariDataSourcePoolDestroyerTest {
+
+    @Test(timeout = 60000)
+    public void assertDestroy() throws InterruptedException {
+        HikariDataSource dataSource = new HikariDataSource();
+        new HikariDataSourcePoolDestroyer().destroy(dataSource);
+        while (!dataSource.isClosed()) {
+            // Test will fail by timeout if dataSource is not closed.
+            Thread.sleep(10L);
+        }
+    }
+
+    @Test
+    public void assertGetType() {
+        assertThat(new HikariDataSourcePoolDestroyer().getType(), is(HikariDataSource.class.getCanonicalName()));
+    }
+
+    @Test
+    public void assertIsDefault() {
+        assertFalse(new HikariDataSourcePoolDestroyer().isDefault());
+    }

Review comment:
       There is unnecessary to assert static get method, could you remove this test case?

##########
File path: shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/config/datasource/pool/destroyer/impl/DefaultDataSourcePoolDestroyerTest.java
##########
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.infra.config.datasource.pool.destroyer.impl;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+import static org.mockito.Mockito.doThrow;
+import static org.mockito.Mockito.mock;
+
+import java.sql.SQLException;
+
+import com.zaxxer.hikari.HikariDataSource;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.junit.MockitoJUnitRunner;
+
+@RunWith(MockitoJUnitRunner.class)
+public final class DefaultDataSourcePoolDestroyerTest {
+
+    @Test
+    public void assertDestroy() {
+        try {
+            HikariDataSource dataSource = new HikariDataSource();
+            new DefaultDataSourcePoolDestroyer().destroy(dataSource);
+            assertThat(dataSource.isClosed(), is(true));
+        } catch (SQLException ex) {
+            fail();
+        }
+    }
+
+    @Test(expected = SQLException.class)
+    public void assertDestroyWithException() throws SQLException {
+        HikariDataSource dataSource = mock(HikariDataSource.class);
+        doThrow(new RuntimeException()).when(dataSource).close();
+        new DefaultDataSourcePoolDestroyer().destroy(dataSource);
+    }
+    
+    @Test
+    public void assertGetType() {
+        assertThat(new DefaultDataSourcePoolDestroyer().getType(), is("Default"));
+    }

Review comment:
       There is unnecessary to assert static get method, could you remove this test case?

##########
File path: shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/config/datasource/pool/destroyer/impl/DefaultDataSourcePoolDestroyerTest.java
##########
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.infra.config.datasource.pool.destroyer.impl;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+import static org.mockito.Mockito.doThrow;
+import static org.mockito.Mockito.mock;
+
+import java.sql.SQLException;
+
+import com.zaxxer.hikari.HikariDataSource;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.junit.MockitoJUnitRunner;
+
+@RunWith(MockitoJUnitRunner.class)
+public final class DefaultDataSourcePoolDestroyerTest {
+
+    @Test
+    public void assertDestroy() {
+        try {
+            HikariDataSource dataSource = new HikariDataSource();
+            new DefaultDataSourcePoolDestroyer().destroy(dataSource);
+            assertThat(dataSource.isClosed(), is(true));
+        } catch (SQLException ex) {
+            fail();
+        }
+    }
+
+    @Test(expected = SQLException.class)
+    public void assertDestroyWithException() throws SQLException {
+        HikariDataSource dataSource = mock(HikariDataSource.class);
+        doThrow(new RuntimeException()).when(dataSource).close();
+        new DefaultDataSourcePoolDestroyer().destroy(dataSource);
+    }
+    
+    @Test
+    public void assertGetType() {
+        assertThat(new DefaultDataSourcePoolDestroyer().getType(), is("Default"));
+    }
+
+    @Test
+    public void assertIsDefault() {
+        assertTrue(new DefaultDataSourcePoolDestroyer().isDefault());
+    }

Review comment:
       There is unnecessary to assert static get method, could you remove this test case?

##########
File path: shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/config/datasource/pool/destroyer/impl/DefaultDataSourcePoolDestroyerTest.java
##########
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.infra.config.datasource.pool.destroyer.impl;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+import static org.mockito.Mockito.doThrow;
+import static org.mockito.Mockito.mock;
+
+import java.sql.SQLException;
+
+import com.zaxxer.hikari.HikariDataSource;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.junit.MockitoJUnitRunner;
+
+@RunWith(MockitoJUnitRunner.class)
+public final class DefaultDataSourcePoolDestroyerTest {
+
+    @Test
+    public void assertDestroy() {
+        try {
+            HikariDataSource dataSource = new HikariDataSource();
+            new DefaultDataSourcePoolDestroyer().destroy(dataSource);
+            assertThat(dataSource.isClosed(), is(true));

Review comment:
       Please use assertTrue for unary assertion

##########
File path: shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/config/datasource/pool/destroyer/DataSourcePoolDestroyerFactoryTest.java
##########
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.infra.config.datasource.pool.destroyer;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.fail;
+
+import java.sql.SQLException;
+
+import com.zaxxer.hikari.HikariDataSource;
+
+import org.apache.commons.dbcp2.BasicDataSource;
+import org.junit.Test;
+
+public final class DataSourcePoolDestroyerFactoryTest {
+    
+    @Test(timeout = 60000)
+    public void assertDestroyForHikari() throws InterruptedException {
+        try {
+            HikariDataSource dataSource = new HikariDataSource();
+            DataSourcePoolDestroyerFactory.destroy(dataSource);
+            while (!dataSource.isClosed()) {
+                // Test will fail by timeout if dataSource is not closed.

Review comment:
       Could you remove the comment? I think the code has already explain all things.




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

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] terrymanu commented on pull request #14561: Add test cases for DataSourceDestroyer for #14039

Posted by GitBox <gi...@apache.org>.
terrymanu commented on pull request #14561:
URL: https://github.com/apache/shardingsphere/pull/14561#issuecomment-1025202191


   @takuya1981 Thank for best contribution, I just leave the last message, I think we can merge this pr soon.


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

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] takuya1981 commented on pull request #14561: Add test cases for DataSourceDestroyer for #14039

Posted by GitBox <gi...@apache.org>.
takuya1981 commented on pull request #14561:
URL: https://github.com/apache/shardingsphere/pull/14561#issuecomment-1006295362


   2 questions.
   
   - The class name with the word "Pool" in it is the one to be tested. Is it right??
   - Since HikariDataSourcePoolDestroyer.destroy() to be tested is asynchronous and there is no callback, I used Thread.sleep().
   It's a bit not good, can I use a library like awaitility?


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

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] terrymanu merged pull request #14561: Add test cases for DataSourceDestroyer for #14039

Posted by GitBox <gi...@apache.org>.
terrymanu merged pull request #14561:
URL: https://github.com/apache/shardingsphere/pull/14561


   


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

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org