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

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

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

    https://github.com/apache/drill/pull/904#discussion_r134259055
  
    --- Diff: 
exec/java-exec/src/test/java/org/apache/drill/exec/fn/impl/TestDateFunctions.java
 ---
    @@ -43,6 +46,11 @@
     public class TestDateFunctions extends PopUnitTestBase {
         static final org.slf4j.Logger logger = 
org.slf4j.LoggerFactory.getLogger(TestDateFunctions.class);
     
    +    @BeforeClass
    +    public static void setupLocal() {
    +        Locale.setDefault(new Locale("en", "US"));
    --- End diff --
    
    This change also affects other unit tests which will be executed after the 
tests in this class. 
    So to avoid this, for each unit test which depends on the locale, we should:
    1. preserve current locale
    2. change locale to "en"
    3. execute test (in the try block)
    4. restore locale (in the finally block).
    
    As the example, you may use test testConstantFolding_allTypes() from the 
class TestConstantFolding below.


> date time test cases is not Local independent
> ---------------------------------------------
>
>                 Key: DRILL-5717
>                 URL: https://issues.apache.org/jira/browse/DRILL-5717
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Tools, Build & Test
>    Affects Versions: 1.9.0, 1.11.0
>            Reporter: weijie.tong
>
> Some date time test cases like  JodaDateValidatorTest  is not Local 
> independent .This will cause other Local's users's test phase to fail. We 
> should let these test cases to be Local env independent.



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

Reply via email to