You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by GitBox <gi...@apache.org> on 2022/04/07 05:22:48 UTC

[GitHub] [incubator-seatunnel] ruanwenjun opened a new issue, #1670: [Bug] [UT] CompleteTest#testVariables failed due to system property not set

ruanwenjun opened a new issue, #1670:
URL: https://github.com/apache/incubator-seatunnel/issues/1670

   ### Search before asking
   
   - [X] I had searched in the [issues](https://github.com/apache/incubator-seatunnel/issues?q=is%3Aissue+label%3A%22bug%22) and found no similar issues.
   
   
   ### What happened
   
   We have an Ut case failed in related PR.
   ```java
       @Test
       public void testVariables() {
   
           System.setProperty("dt", "20190318");
           System.setProperty("city2", "shanghai");
   
           Config config = ConfigFactory
               .parseFile(FileUtils.getFileFromResources("seatunnel/variables.conf"))
               .resolveWith(ConfigFactory.systemProperties(), ConfigResolveOptions.defaults().setAllowUnresolved(true));
   
           String sql1 = config.getConfigList("transform").get(1).getString("sql");
           String sql2 = config.getConfigList("transform").get(2).getString("sql");
   
           Assert.assertTrue(sql1.contains("shanghai"));
           Assert.assertTrue(sql2.contains("20190318"));
   ```
   This is caused when we execute `ConfigFactory.systemProperties()` cannot get the property `dt`, `city2`.
   I find the method `ConfigFactory.systemProperties()` will return a static field `systemProperties`, this field will only be loaded when the first time we load class `SystemPropertiesHolder`.
   
   So if we load the class before we execute this UT, then the UT will failed.
   
   
   ### SeaTunnel Version
   
   dev
   
   ### SeaTunnel Config
   
   ```conf
   no
   ```
   
   
   ### Running Command
   
   ```shell
   no
   ```
   
   
   ### Error Exception
   
   ```log
   no
   ```
   
   
   ### Flink or Spark Version
   
   _No response_
   
   ### Java or Scala Version
   
   _No response_
   
   ### Screenshots
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
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: commits-unsubscribe@seatunnel.apache.org.apache.org

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


[GitHub] [incubator-seatunnel] CalvinKirs closed issue #1670: [Bug] [UT] CompleteTest#testVariables failed due to system property not set

Posted by GitBox <gi...@apache.org>.
CalvinKirs closed issue #1670: [Bug] [UT] CompleteTest#testVariables failed due to system property not set
URL: https://github.com/apache/incubator-seatunnel/issues/1670


-- 
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: commits-unsubscribe@seatunnel.apache.org

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