You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@jclouds.apache.org by Andrew Gaul <no...@github.com> on 2014/07/17 12:37:03 UTC

[jclouds] Enable more filesystem integration tests (#444)

Other tests will require Java 7 xattr support.
You can merge this Pull Request by running:

  git pull https://github.com/andrewgaul/jclouds filesystem-tests

Or you can view, comment on it, or merge it online at:

  https://github.com/jclouds/jclouds/pull/444

-- Commit Summary --

  * Enable more filesystem integration tests

-- File Changes --

    M apis/filesystem/src/main/java/org/jclouds/filesystem/strategy/internal/FilesystemStorageStrategyImpl.java (8)
    M apis/filesystem/src/test/java/org/jclouds/filesystem/integration/FilesystemBlobIntegrationTest.java (8)
    M apis/filesystem/src/test/java/org/jclouds/filesystem/integration/FilesystemContainerIntegrationTest.java (11)

-- Patch Links --

https://github.com/jclouds/jclouds/pull/444.patch
https://github.com/jclouds/jclouds/pull/444.diff

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/444

Re: [jclouds] Enable more filesystem integration tests (#444)

Posted by Andrew Gaul <no...@github.com>.
>        try {
>           File containerFile = openFolder(container);
>           File[] children = containerFile.listFiles();
>           if (null != children) {
>              for (File child : children)
> -               Utils.deleteRecursively(child);
> +               if (options.isRecursive() || child.isFile()) {

The ordering is optimal; the former is a simple accessor and the latter invokes the `stat` system call.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/444/files#r15136438

Re: [jclouds] Enable more filesystem integration tests (#444)

Posted by Andrew Phillips <no...@github.com>.
> @@ -58,23 +58,21 @@ protected void validateMetadata(BlobMetadata metadata) throws IOException {
>        // TODO: not yet implemented
>     }
>  
> +   // TODO: requires Java 7 xattr support

[minor] Add the message into the SkipException?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/444/files#r15118163

Re: [jclouds] Enable more filesystem integration tests (#444)

Posted by BuildHive <no...@github.com>.
[jclouds » jclouds #1383](https://buildhive.cloudbees.com/job/jclouds/job/jclouds/1383/) FAILURE
Looks like there's a problem with this pull request
[(what's this?)](https://www.cloudbees.com/what-is-buildhive)

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/444#issuecomment-49291009

Re: [jclouds] Enable more filesystem integration tests (#444)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-java-7-pull-requests #1482](https://jclouds.ci.cloudbees.com/job/jclouds-java-7-pull-requests/1482/) ABORTED


---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/444#issuecomment-49545159

Re: [jclouds] Enable more filesystem integration tests (#444)

Posted by Andrew Gaul <no...@github.com>.
Pushed to master as 370194b2be8facb2aa41d503779621a4dcef96dd.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/444#issuecomment-49527218

Re: [jclouds] Enable more filesystem integration tests (#444)

Posted by Andrew Phillips <no...@github.com>.
> Your failures have nothing to do with this pull request I will address them in another commit and 
> rebase this one.

OK, great, thanks! And thanks to KK too, I guess ;-)

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/444#issuecomment-49489936

Re: [jclouds] Enable more filesystem integration tests (#444)

Posted by Andrew Phillips <no...@github.com>.
+1 - looks good to me. But will try to test first, too. Thanks, @andrewgaul!

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/444#issuecomment-49446770

Re: [jclouds] Enable more filesystem integration tests (#444)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-pull-requests #1002](https://jclouds.ci.cloudbees.com/job/jclouds-pull-requests/1002/) SUCCESS
This pull request looks good

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/444#issuecomment-49296246

Re: [jclouds] Enable more filesystem integration tests (#444)

Posted by Andrew Phillips <no...@github.com>.
> Pushed to master

Thanks for the updates, @andrewgaul!

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/444#issuecomment-49553707

Re: [jclouds] Enable more filesystem integration tests (#444)

Posted by Andrew Phillips <no...@github.com>.
I can't see quite how/if this is immediately related to this, but I'm now (f17c87 on master) getting the following (Java 6):
```
testDirectory(org.jclouds.filesystem.integration.FilesystemContainerIntegrationTest)  Time elapsed: 0.048 sec  <<< FAILURE!
java.util.regex.PatternSyntaxException: Unexpected internal error near index 10
directory\
          ^
        at java.util.regex.Pattern.error(Pattern.java:1713)
        at java.util.regex.Pattern.compile(Pattern.java:1466)
        at java.util.regex.Pattern.<init>(Pattern.java:1133)
        at java.util.regex.Pattern.compile(Pattern.java:823)
        at java.lang.String.replaceFirst(String.java:2146)
        at org.jclouds.blobstore.LocalAsyncBlobStore$CommonPrefixes.apply(LocalA
syncBlobStore.java:362)
        at org.jclouds.blobstore.LocalAsyncBlobStore$CommonPrefixes.apply(LocalA
syncBlobStore.java:346)
        at com.google.common.collect.Iterators$8.transform(Iterators.java:794)
        at com.google.common.collect.TransformedIterator.next(TransformedIterato
r.java:48)
        at com.google.common.collect.Iterators.addAll(Iterators.java:357)
        at com.google.common.collect.Iterables.addAll(Iterables.java:354)
        at com.google.common.collect.Sets.newTreeSet(Sets.java:365)
        at org.jclouds.blobstore.LocalAsyncBlobStore.list(LocalAsyncBlobStore.ja
va:193)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.google.inject.internal.DelegatingInvocationHandler.invoke(Delegat
ingInvocationHandler.java:37)
        at $Proxy45.list(Unknown Source)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.google.common.reflect.Invokable$MethodInvokable.invokeInternal(In
vokable.java:197)
        at com.google.common.reflect.Invokable.invoke(Invokable.java:102)
        at org.jclouds.rest.internal.InvokeAndCallGetOnFutures.apply(InvokeAndCa
llGetOnFutures.java:67)
        at org.jclouds.rest.internal.InvokeAndCallGetOnFutures.apply(InvokeAndCa
llGetOnFutures.java:39)
        at org.jclouds.rest.internal.DelegatesToInvocationFunction.handle(Delega
tesToInvocationFunction.java:156)
        at org.jclouds.rest.internal.DelegatesToInvocationFunction.invoke(Delega
tesToInvocationFunction.java:123)
        at $Proxy46.list(Unknown Source)
        at org.jclouds.blobstore.integration.internal.BaseContainerIntegrationTe
st.testDirectory(BaseContainerIntegrationTest.java:181)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocat
ionHelper.java:84)
        at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
        at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
        at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
        at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWork
er.java:127)
        at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
        at org.testng.TestRunner.privateRun(TestRunner.java:767)
        at org.testng.TestRunner.run(TestRunner.java:617)
        at org.testng.SuiteRunner.runTest(SuiteRunner.java:348)
        at org.testng.SuiteRunner.access$000(SuiteRunner.java:38)
        at org.testng.SuiteRunner$SuiteWorker.run(SuiteRunner.java:382)
        at org.testng.internal.thread.ThreadUtil$2.call(ThreadUtil.java:64)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
        at java.util.concurrent.FutureTask.run(FutureTask.java:138)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
utor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:908)
        at java.lang.Thread.run(Thread.java:619)

Results :

Failed tests:
  FilesystemContainerIntegrationTest>BaseContainerIntegrationTest.testDirectory:
181 ╗ PatternSyntax

Tests run: 26, Failures: 1, Errors: 0, Skipped: 5

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 32.373 s
[INFO] Finished at: 2014-07-21T00:03:08+01:00
[INFO] Final Memory: 72M/232M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.17:test (integration) on project filesystem: There are test failures.
[ERROR]
```
It looks like [this](https://github.com/jclouds/jclouds/blob/master/blobstore/src/main/java/org/jclouds/blobstore/LocalAsyncBlobStore.java#L360), when called from [list](https://github.com/jclouds/jclouds/blob/master/blobstore/src/main/java/org/jclouds/blobstore/LocalAsyncBlobStore.java#L192-194) with a Windows line separator (which needs to be regex-escaped) is buggy.

Should I open a new JIRA issue for this?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/444#issuecomment-49561197

Re: [jclouds] Enable more filesystem integration tests (#444)

Posted by Andrew Gaul <no...@github.com>.
> @@ -58,23 +58,21 @@ protected void validateMetadata(BlobMetadata metadata) throws IOException {
>        // TODO: not yet implemented
>     }
>  
> +   // TODO: requires Java 7 xattr support

Done.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/444/files#r15136617

Re: [jclouds] Enable more filesystem integration tests (#444)

Posted by BuildHive <no...@github.com>.
[jclouds » jclouds #1394](https://buildhive.cloudbees.com/job/jclouds/job/jclouds/1394/) SUCCESS
This pull request looks good
[(what's this?)](https://www.cloudbees.com/what-is-buildhive)

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/444#issuecomment-49509283

Re: [jclouds] Enable more filesystem integration tests (#444)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-java-7-pull-requests #1473](https://jclouds.ci.cloudbees.com/job/jclouds-java-7-pull-requests/1473/) ABORTED


---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/444#issuecomment-49407232

Re: [jclouds] Enable more filesystem integration tests (#444)

Posted by Andrew Gaul <no...@github.com>.
@demobox I enabled `testDirectory` in this commit so this commit uncovered this failure.  The fix might be as simple as escaping backslashes at https://github.com/jclouds/jclouds/blob/master/blobstore/src/main/java/org/jclouds/blobstore/LocalAsyncBlobStore.java#L362 or using a non-regex approach.  Can you investigate this or open a JIRA issue?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/444#issuecomment-49675241

Re: [jclouds] Enable more filesystem integration tests (#444)

Posted by Andrew Gaul <no...@github.com>.
@demobox Are these new failures or did they exist before my changes?  Sleeping in `org.jclouds.filesystem.util.Utils.deleteRecursively` is obviously incorrect and looks like it is trying to let the garbage collector close an open `FileInputStream`.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/444#issuecomment-49486339

Re: [jclouds] Enable more filesystem integration tests (#444)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-pull-requests #1006](https://jclouds.ci.cloudbees.com/job/jclouds-pull-requests/1006/) SUCCESS
This pull request looks good

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/444#issuecomment-49490822

Re: [jclouds] Enable more filesystem integration tests (#444)

Posted by Andrew Phillips <no...@github.com>.
Here's Java 6. Again, unit tests pass but integration tests fail:
```
...jclouds\apis\filesystem> mvn -v
Apache Maven 3.2.1 (ea8b2b07643dbb1b84b6d16e1f08391b666bc1e9; 2014-02-14T18:37:52+01:00)
Maven home: C:\Program Files (x86)\Apache\maven-3.2.1\bin\..
Java version: 1.6.0_20, vendor: Sun Microsystems Inc.
Java home: C:\Program Files\Java\jdk1.6.0_20\jre
Default locale: en_GB, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"

> mvn clean integration-test
Results :

Failed tests:
  FilesystemBlobIntegrationTest>BaseBlobIntegrationTest.testPutObject:496->BaseB
lobStoreIntegrationTest.getContainerName:432->BaseBlobStoreIntegrationTest.creat
eContainerAndEnsureEmpty:261->BaseBlobStoreIntegrationTest.createContainerAndEns
ureEmpty:257 ╗ Runtime
  FilesystemBlobIntegrationTest>BaseBlobIntegrationTest.testPutObjectStream:520-
>BaseBlobStoreIntegrationTest.getContainerName:432->BaseBlobStoreIntegrationTest
.createContainerAndEnsureEmpty:261->BaseBlobStoreIntegrationTest.createContainer
AndEnsureEmpty:257 ╗ Runtime
  FilesystemContainerIntegrationTest>BaseContainerIntegrationTest.testClearWhenC
ontentsUnderPath:103->BaseBlobStoreIntegrationTest.getContainerName:432->BaseBlo
bStoreIntegrationTest.createContainerAndEnsureEmpty:261->BaseBlobStoreIntegratio
nTest.createContainerAndEnsureEmpty:257 ╗ Runtime
  FilesystemContainerIntegrationTest>BaseContainerIntegrationTest.testDirectory:
154->BaseBlobStoreIntegrationTest.getContainerName:432->BaseBlobStoreIntegration
Test.createContainerAndEnsureEmpty:261->BaseBlobStoreIntegrationTest.createConta
inerAndEnsureEmpty:257 ╗ Runtime

Tests run: 26, Failures: 4, Errors: 0, Skipped: 5

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:06 min
[INFO] Finished at: 2014-07-18T18:28:56+01:00
[INFO] Final Memory: 28M/230M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.
17:test (integration) on project filesystem: There are test failures.
```
Looks like it might be something to do with the "delete recursively" stuff? I see things like:
```
Caused by: java.io.IOException: Could not delete: .\target\basedir\aphillips-blobstore8\apples
        at org.jclouds.filesystem.util.Utils.deleteRecursively(Utils.java:48)
        at org.jclouds.filesystem.util.Utils.deleteRecursively(Utils.java:40)
        at org.jclouds.filesystem.strategy.internal.FilesystemStorageStrategyImpl.deleteDirectory(FilesystemStorageStrategyImpl.java:294)
        ... 45 more
```
in the output.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/444#issuecomment-49451262

Re: [jclouds] Enable more filesystem integration tests (#444)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-pull-requests #1011](https://jclouds.ci.cloudbees.com/job/jclouds-pull-requests/1011/) UNSTABLE
Looks like there's a problem with this pull request

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/444#issuecomment-49509605

Re: [jclouds] Enable more filesystem integration tests (#444)

Posted by Andrew Gaul <no...@github.com>.
I found multiple fd leaks due to poor `Payload` management via Kohsuke's file-leak-detector.  Your failures have nothing to do with this pull request I will address them in another commit and rebase this one.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/444#issuecomment-49486973

Re: [jclouds] Enable more filesystem integration tests (#444)

Posted by Andrew Gaul <no...@github.com>.
Closed #444.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/444#event-143391972

Re: [jclouds] Enable more filesystem integration tests (#444)

Posted by Andrew Gaul <no...@github.com>.
@demobox @zack-shoylev Can you test this on Windows?  I would also like to remove the hack at `org.jclouds.filesystem.util.Utils.deleteRecursively`; we should not need retry logic on Window since I addressed `FileInputStream` leaks in other commits.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/444#issuecomment-49290705

Re: [jclouds] Enable more filesystem integration tests (#444)

Posted by Andrew Phillips <no...@github.com>.
Here's the output on Java 7:
```
> mvn -v
Apache Maven 3.2.1 (ea8b2b07643dbb1b84b6d16e1f08391b666bc1e9; 2014-02-14T18:37:5
2+01:00)
Maven home: C:\Program Files (x86)\Apache\maven-3.2.1\bin\..
Java version: 1.7.0_40, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.7.0_40\jre
Default locale: en_GB, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"

> mvn clean test
...
Tests run: 66, Failures: 0, Errors: 0, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 06:50 min
[INFO] Finished at: 2014-07-18T18:18:17+01:00
[INFO] Final Memory: 20M/123M
[INFO] ------------------------------------------------------------------------
```

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/444#issuecomment-49450186

Re: [jclouds] Enable more filesystem integration tests (#444)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-java-7-pull-requests #1477](https://jclouds.ci.cloudbees.com/job/jclouds-java-7-pull-requests/1477/) SUCCESS
This pull request looks good

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/444#issuecomment-49491382

Re: [jclouds] Enable more filesystem integration tests (#444)

Posted by Andrew Phillips <no...@github.com>.
>        try {
>           File containerFile = openFolder(container);
>           File[] children = containerFile.listFiles();
>           if (null != children) {
>              for (File child : children)
> -               Utils.deleteRecursively(child);
> +               if (options.isRecursive() || child.isFile()) {

Very minor comment: which one is more likely to be true? If `isRecursive` is usually false, would it make sense to reverse the order of the checks?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/444/files#r15118136