You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-issues@hadoop.apache.org by "Colin Patrick McCabe (JIRA)" <ji...@apache.org> on 2012/09/26 01:02:08 UTC

[jira] [Updated] (HDFS-3753) Tests don't run with native libraries

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

Colin Patrick McCabe updated HDFS-3753:
---------------------------------------

    Attachment: HDFS-3753.001.patch

This patch adds the hadoop-common native library directory to LD_LIBRARY_PATH, so that the junit tests of other projects, such as hadoop-hdfs-project, will be run with libhadoop.so if -Pnative was specified.  This ensures that we get test coverage of HDFS running with libhadoop.so present.

This patch also adds two new junit tests, TestNativeCodeLoader and TestHdfsNativeCodeLoader.  If the system property {{\-Drequire.test.libhadoop}} is set, these tests will ensure that libhadoop.so is actually being tested.  This is important for repeatable builds, and to prevent this bug from cropping up again--  for example if libhadoop.so is moved.

Finally, this adds {{\-Drequire.test.libhadoop}} to test-patch.sh.  This ensures that any regressions that lead to libhadoop.so not being tested are spotted by Jenkins.
                
> Tests don't run with native libraries
> -------------------------------------
>
>                 Key: HDFS-3753
>                 URL: https://issues.apache.org/jira/browse/HDFS-3753
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: build, test
>    Affects Versions: 2.0.0-alpha
>            Reporter: Eli Collins
>
> Test execution when run with the native flag and native libraries have been built don't actually use the native libs because NativeCodeLoader is unable to load native-hadoop. Eg run {{mvn compile -Pnative}} then {{mvn -Dtest=TestSeekBug test -Pnative}} and check the test output. This is because the test's java.library.path is looking for the lib in hdfs (
> hadoop-hdfs-project/hadoop-hdfs/target/native/target/usr/local/lib) however the native lib lives in common. I confirmed copying the lib to the appropriate directory fixes things. We need to update the java.library.path for test execution to include the common lib dir.  This may be an issue with MR as well.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira