Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added S3 test tools to help with directory uploading #5442

Merged

Conversation

devinrsmith
Copy link
Member

As part of this, the bootstrapping S3 client was changed from sync to async to support S3TransferManager. Deleting keys has also been automated (unit tests no longer responsible for keeping track of keys used).

SingletonContainers, LocalStack, and MinIO have been made public; this allows the container bootstrapping logic to be used by other projects' tests.

These changes should make it easier for Iceberg testing in #5277

As part of this, the bootstrapping S3 client was changed from sync to async to support S3TransferManager. Deleting keys has also been automated (unit tests no longer responsible for keeping track of keys used).

SingletonContainers, LocalStack, and MinIO have been made public; this allows the container bootstrapping logic to be used by other projects' tests.
@devinrsmith devinrsmith added this to the 2. April 2024 milestone May 1, 2024
@devinrsmith devinrsmith self-assigned this May 1, 2024
Comment on lines +58 to +59
S3Helper.deleteAllKeys(asyncClient, bucket);
asyncClient.deleteBucket(DeleteBucketRequest.builder().bucket(bucket).build()).get(5, TimeUnit.SECONDS);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More a question than a comment: is there a way to upload a set of files and share between individual tests? Am I reading this correctly that each test must do its own setup / upload?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's just how this specific test orchestrates them. You can definitely upload once per class (org.junit.jupiter.api.BeforeAll JUnit 5, org.junit.BeforeClass JUnit 4), or even statically once per JVM.

ListObjectsV2Request.builder().bucket(bucket).continuationToken(nextContinuationToken).build())
.get(5, TimeUnit.SECONDS);
}
CompletableFuture.allOf(futures.stream().toArray(CompletableFuture[]::new)).get(5, TimeUnit.SECONDS);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
CompletableFuture.allOf(futures.stream().toArray(CompletableFuture[]::new)).get(5, TimeUnit.SECONDS);
CompletableFuture.allOf(futures.toArray(CompletableFuture[]::new)).get(5, TimeUnit.SECONDS);

@devinrsmith devinrsmith merged commit dfaafbb into deephaven:main May 1, 2024
15 checks passed
@devinrsmith devinrsmith deleted the s3-async-testing-transfer-manager branch May 1, 2024 21:43
@github-actions github-actions bot locked and limited conversation to collaborators May 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants