[ 
https://issues.apache.org/jira/browse/HADOOP-14180?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Mingliang Liu updated HADOOP-14180:
-----------------------------------
    Attachment: HADOOP-14180.001.patch

[~ste...@apache.org] Thanks for reviewing this. For the NPE failing tests, I 
found the root cause is that, the tests should not run if {{fs}} and/or 
{{testAccount}} is not initialized. This behavior was previously controlled by 
overriding the runTest() method, like:
{code}
59        @Override             
60        protected void runTest() throws Throwable {           
61          if (testAccount != null) {          
62            super.runTest();          
63          }           
64        }
{code}
But w/ the v0 patch, we deleted this check. A simple fix is to call 
{{assumeNotNull(fs)}} in the {{@Before setUp()}} method of each subclass where 
{{fs}} may be not initialized per config, e.g. 
{{TestNativeAzureFileSystemContractPageBlobLive}}, 
{{TestNativeAzureFileSystemContractEmulator}}, and 
{{TestNativeAzureFileSystemContractLive}}. I updated this in the v1 patch.

Meanwhile, the v0 patch misses the {{TestAliyunOSSFileSystemContract}} and v1 
patch also fixes it.

> FileSystem contract tests to replace JUnit 3 with 4
> ---------------------------------------------------
>
>                 Key: HADOOP-14180
>                 URL: https://issues.apache.org/jira/browse/HADOOP-14180
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs
>            Reporter: Mingliang Liu
>            Assignee: Xiaobing Zhou
>              Labels: test
>         Attachments: HADOOP-14180.000.patch, HADOOP-14180.001.patch
>
>
> This is from discussion in [HADOOP-14170], as Steve commented:
> {quote}
> ...it's time to move this to JUnit 4, annotate all tests with @test, and make 
> the test cases skip if they don't have the test FS defined. JUnit 3 doesn't 
> support Assume, so when I do test runs without the s3n or s3 fs specced, I 
> get lots of errors I just ignore.
> ...Move to Junit 4, and, in our own code, find everywhere we've subclassed a 
> method to make the test a no-op, and insert an Assume.assumeTrue(false) in 
> there so they skip properly.
> {quote}



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

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org

Reply via email to