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 2021/02/25 07:48:29 UTC

[GitHub] [shardingsphere-elasticjob] lzx404243 opened a new pull request #1838: Close dataSource in RDBJobEventStorageTest when each test finishes

lzx404243 opened a new pull request #1838:
URL: https://github.com/apache/shardingsphere-elasticjob/pull/1838


   Fixes #1837.
   
   Changes proposed in this pull request:
   -  Add a `teardown()` function to close `dataSource` in `RDBJobEventStorageTest` when each test finishes.
   
   With the proposed fix, the test does not pollute the shared state (and passes when run twice in the same JVM).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

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



[GitHub] [shardingsphere-elasticjob] lzx404243 commented on a change in pull request #1838: Close dataSource in RDBJobEventStorageTest when each test finishes

Posted by GitBox <gi...@apache.org>.
lzx404243 commented on a change in pull request #1838:
URL: https://github.com/apache/shardingsphere-elasticjob/pull/1838#discussion_r583447785



##########
File path: elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorageTest.java
##########
@@ -38,17 +39,24 @@
 public final class RDBJobEventStorageTest {
     
     private RDBJobEventStorage storage;
+
+    private BasicDataSource dataSource;
     
     @Before
     public void setup() throws SQLException {
-        BasicDataSource dataSource = new BasicDataSource();
+        dataSource = new BasicDataSource();
         dataSource.setDriverClassName(org.h2.Driver.class.getName());
         dataSource.setUrl("jdbc:h2:mem:job_event_storage");
         dataSource.setUsername("sa");
         dataSource.setPassword("");
         storage = new RDBJobEventStorage(dataSource);
     }
     
+    @After
+    public void teardown() throws SQLException{

Review comment:
       Thanks for reviewing! The checkstyle is fixed.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

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



[GitHub] [shardingsphere-elasticjob] TeslaCN commented on a change in pull request #1838: Close dataSource in RDBJobEventStorageTest when each test finishes

Posted by GitBox <gi...@apache.org>.
TeslaCN commented on a change in pull request #1838:
URL: https://github.com/apache/shardingsphere-elasticjob/pull/1838#discussion_r582620613



##########
File path: elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorageTest.java
##########
@@ -38,17 +39,24 @@
 public final class RDBJobEventStorageTest {
     
     private RDBJobEventStorage storage;
+
+    private BasicDataSource dataSource;
     
     @Before
     public void setup() throws SQLException {
-        BasicDataSource dataSource = new BasicDataSource();
+        dataSource = new BasicDataSource();
         dataSource.setDriverClassName(org.h2.Driver.class.getName());
         dataSource.setUrl("jdbc:h2:mem:job_event_storage");
         dataSource.setUsername("sa");
         dataSource.setPassword("");
         storage = new RDBJobEventStorage(dataSource);
     }
     
+    @After
+    public void teardown() throws SQLException{

Review comment:
       Thanks for your contribution!
   Please fix the checkstyle.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

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



[GitHub] [shardingsphere-elasticjob] TeslaCN merged pull request #1838: Close dataSource in RDBJobEventStorageTest when each test finishes

Posted by GitBox <gi...@apache.org>.
TeslaCN merged pull request #1838:
URL: https://github.com/apache/shardingsphere-elasticjob/pull/1838


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

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