You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@jclouds.apache.org by Roman Coedo <no...@github.com> on 2014/07/22 17:51:15 UTC
[jclouds-labs-aws] JCLOUDS-457: Long live tests (#41)
The long live tests have been added. These tests takes several
hours and will leave traces in your AWS account.
You can merge this Pull Request by running:
git pull https://github.com/rcoedo/jclouds-labs-aws longlivetestsup
Or you can view, comment on it, or merge it online at:
https://github.com/jclouds/jclouds-labs-aws/pull/41
-- Commit Summary --
* JCLOUDS-457: Long live tests
-- File Changes --
M glacier/pom.xml (50)
M glacier/src/main/java/org/jclouds/glacier/domain/JobMetadata.java (4)
M glacier/src/test/java/org/jclouds/glacier/GlacierClientLongLiveTest.java (109)
-- Patch Links --
https://github.com/jclouds/jclouds-labs-aws/pull/41.patch
https://github.com/jclouds/jclouds-labs-aws/pull/41.diff
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-aws/pull/41
Re: [jclouds-labs-aws] JCLOUDS-457: Long live tests (#41)
Posted by BuildHive <no...@github.com>.
[jclouds » jclouds-labs-aws #1173](https://buildhive.cloudbees.com/job/jclouds/job/jclouds-labs-aws/1173/) 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-labs-aws/pull/41#issuecomment-49759319
Re: [jclouds-labs-aws] JCLOUDS-457: Long live tests (#41)
Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-labs-aws-pull-requests #91](https://jclouds.ci.cloudbees.com/job/jclouds-labs-aws-pull-requests/91/) SUCCESS
This pull request looks good
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-aws/pull/41#issuecomment-49851815
Re: [jclouds-labs-aws] JCLOUDS-457: Long live tests (#41)
Posted by Andrew Gaul <no...@github.com>.
> public class GlacierClientLongLiveTest extends BaseApiLiveTest<GlacierClient>{
>
> + private static final long PART_SIZE = 1;
> + private static final long INITIAL_WAIT = 10800000L; //3 hours
> + private static final long TIME_BETWEEN_POLLS = 900000L; //15 minutes
Make these self-documenting with `TimeUnit.HOURS.toMillis(3)` and `TimeUnit.MINUTES.toMillis(15)`?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-aws/pull/41/files#r15262465
Re: [jclouds-labs-aws] JCLOUDS-457: Long live tests (#41)
Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-labs-aws-pull-requests #89](https://jclouds.ci.cloudbees.com/job/jclouds-labs-aws-pull-requests/89/) SUCCESS
This pull request looks good
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-aws/pull/41#issuecomment-49760175
Re: [jclouds-labs-aws] JCLOUDS-457: Long live tests (#41)
Posted by BuildHive <no...@github.com>.
[jclouds » jclouds-labs-aws #1180](https://buildhive.cloudbees.com/job/jclouds/job/jclouds-labs-aws/1180/) 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-labs-aws/pull/41#issuecomment-49852369
Re: [jclouds-labs-aws] JCLOUDS-457: Long live tests (#41)
Posted by Andrew Gaul <no...@github.com>.
> + assertThat(api.describeJob(VAULT_NAME, inventoryRetrievalJob).getStatusCode()).isEqualTo(JobStatus.SUCCEEDED);
> + }
> +
> + @Test(groups = {"live", "livelong", "longtest"}, dependsOnMethods = {"testWaitForSucceed"})
> + public void testGetJobOutput() throws IOException {
> + InputStream inputStream = api.getJobOutput(VAULT_NAME, archiveRetrievalJob).openStream();
> + try {
> + InputStream expectedInputStream = buildData(PART_SIZE * 2 * MiB).openStream();
> + try {
> + assertThat(inputStream).hasContentEqualTo(expectedInputStream);
> + } finally {
> + expectedInputStream.close();
> + }
> + } finally {
> + inputStream.close();
> + }
`Closer` helps write this more succinctly in Java 6 (Java 7 introduces try-with-resources):
```
Closer closer = Closer.create();
try {
InputStream inputStream = closer.register(api.getJobOutput(VAULT_NAME, archiveRetrievalJob).openStream());
InputStream expectedInputStream = closer.register(buildData(PART_SIZE * 2 * MiB).openStream());
assertThat(inputStream).hasContentEqualTo(expectedInputStream);
} finally {
closer.close();
}
```
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-aws/pull/41/files#r15323510
Re: [jclouds-labs-aws] JCLOUDS-457: Long live tests (#41)
Posted by BuildHive <no...@github.com>.
[jclouds » jclouds-labs-aws #1182](https://buildhive.cloudbees.com/job/jclouds/job/jclouds-labs-aws/1182/) 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-labs-aws/pull/41#issuecomment-49964849
Re: [jclouds-labs-aws] JCLOUDS-457: Long live tests (#41)
Posted by Andrew Gaul <no...@github.com>.
Tests completed successfully after four hours:
```
Tests run: 9, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 15,322.67 sec - in TestSuite
```
Squashed commits and pushed to master as 6a8586ab0695bc055e01afb1d74e36c1ea7f9ce6.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-aws/pull/41#issuecomment-49998689
Re: [jclouds-labs-aws] JCLOUDS-457: Long live tests (#41)
Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-labs-aws-pull-requests #93](https://jclouds.ci.cloudbees.com/job/jclouds-labs-aws-pull-requests/93/) SUCCESS
This pull request looks good
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-aws/pull/41#issuecomment-49964602
Re: [jclouds-labs-aws] JCLOUDS-457: Long live tests (#41)
Posted by Andrew Gaul <no...@github.com>.
> + }
> +
> + @Test(groups = {"live", "livelong", "longtest"}, dependsOnMethods = {"testInitiateJob", "testDescribeJob", "testListJobs"})
> + public void testWaitForSucceed() throws InterruptedException {
> + Thread.sleep(INITIAL_WAIT);
> + while(api.describeJob(VAULT_NAME, archiveRetrievalJob).getStatusCode() == JobStatus.IN_PROGRESS ||
> + api.describeJob(VAULT_NAME, inventoryRetrievalJob).getStatusCode() == JobStatus.IN_PROGRESS) {
> + Thread.sleep(TIME_BETWEEN_POLLS);
> + }
> + assertThat(api.describeJob(VAULT_NAME, archiveRetrievalJob).getStatusCode()).isEqualTo(JobStatus.SUCCEEDED);
> + assertThat(api.describeJob(VAULT_NAME, inventoryRetrievalJob).getStatusCode()).isEqualTo(JobStatus.SUCCEEDED);
> + }
> +
> + @Test(groups = {"live", "livelong", "longtest"}, dependsOnMethods = {"testWaitForSucceed"})
> + public void testGetJobOutput() throws IOException {
> + assertThat(ByteSources.asByteSource(api.getJobOutput(VAULT_NAME, archiveRetrievalJob).openStream()))
`ByteSources.asByteSource` is kind of a dangerous method and I would like to remove it. It breaks the contract of `ByteSource` which specifies that `openStream` can produce multiple independent streams. Can you rewrite this with `assertThat(InputStream).hasSameContentAs` instead? This will require some verbosity to close the `InputStream` but when we move to Java 7 this will all read well.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-aws/pull/41/files#r15262670
Re: [jclouds-labs-aws] JCLOUDS-457: Long live tests (#41)
Posted by Andrew Gaul <no...@github.com>.
> @@ -98,6 +98,12 @@
> <version>1.6.1</version>
> <scope>test</scope>
> </dependency>
> + <dependency>
> + <groupId>org.assertj</groupId>
> + <artifactId>assertj-guava</artifactId>
Dependency needed any more?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-aws/pull/41/files#r15323431
Re: [jclouds-labs-aws] JCLOUDS-457: Long live tests (#41)
Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-labs-aws-pull-requests #92](https://jclouds.ci.cloudbees.com/job/jclouds-labs-aws-pull-requests/92/) SUCCESS
This pull request looks good
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-aws/pull/41#issuecomment-49851988
Re: [jclouds-labs-aws] JCLOUDS-457: Long live tests (#41)
Posted by Roman Coedo <no...@github.com>.
No, this is my mistake, I fixed this in a previous version but I think I messed up and lost the changes when introducing the JobStatus.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-aws/pull/41#issuecomment-49964221
Re: [jclouds-labs-aws] JCLOUDS-457: Long live tests (#41)
Posted by Andrew Gaul <no...@github.com>.
Closed #41.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-aws/pull/41#event-145087445
Re: [jclouds-labs-aws] JCLOUDS-457: Long live tests (#41)
Posted by Andrew Gaul <no...@github.com>.
When running `mvn integration-test -pl :glacier -Plivelong` I encounter:
```
testCompleteMultipartUpload(org.jclouds.glacier.GlacierClientLongLiveTest) Time elapsed: 15.761 sec <<< FAILURE!
java.lang.IllegalArgumentException: The total size of uploaded parts [2097152] does not equal the specified archive size [2]
```
Previously I ran `mvn integration-test -pl :glacier -Plivelongsetup`. Is my vault still waiting for its first inventory retrieval?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-aws/pull/41#issuecomment-49952452
Re: [jclouds-labs-aws] JCLOUDS-457: Long live tests (#41)
Posted by BuildHive <no...@github.com>.
[jclouds » jclouds-labs-aws #1181](https://buildhive.cloudbees.com/job/jclouds/job/jclouds-labs-aws/1181/) 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-labs-aws/pull/41#issuecomment-49964577
Re: [jclouds-labs-aws] JCLOUDS-457: Long live tests (#41)
Posted by Andrew Gaul <no...@github.com>.
This looks good and the tests are making progress. Some tests take a few hours so I will wait for their completion before merging.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-aws/pull/41#issuecomment-49970813
Re: [jclouds-labs-aws] JCLOUDS-457: Long live tests (#41)
Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-labs-aws-pull-requests #94](https://jclouds.ci.cloudbees.com/job/jclouds-labs-aws-pull-requests/94/) SUCCESS
This pull request looks good
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-aws/pull/41#issuecomment-49964827