Skip to content

Commit

Permalink
Added some small logs to Aws2KinesisFirehoseTest for better understan…
Browse files Browse the repository at this point in the history
…ding of flaky tests
  • Loading branch information
JiriOndrusek authored and jamesnetherton committed Jun 14, 2024
1 parent 866b095 commit 329cd02
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,10 @@ public void firehose() {
final Config config = ConfigProvider.getConfig();

final String bucketName = config.getValue("aws-kinesis.s3-bucket-name", String.class);

LOG.infof("Bucket '%s' should contain objects.", bucketName);
Awaitility.await().pollInterval(1, TimeUnit.SECONDS).atMost(120, TimeUnit.SECONDS).until(
() -> {
LOG.infof("Reading objects from bucket '%s'", bucketName);
final ListObjectsResponse objects = client
.listObjects(ListObjectsRequest.builder().bucket(bucketName).build());
final List<S3Object> objs = objects.contents();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,12 @@ public void customize(Aws2TestEnvContext envContext) {
final String bucketArn = "arn:aws:s3:::" + bucketName;
envContext.property("aws-kinesis.s3-bucket-name", bucketName);
s3Client.createBucket(CreateBucketRequest.builder().bucket(bucketName).build());
envContext.closeable(() -> s3Client.deleteBucket(DeleteBucketRequest.builder().bucket(bucketName).build()));
envContext.closeable(() -> {
LOG.info("Deleting bucket " + bucketName);
s3Client.deleteBucket(DeleteBucketRequest.builder().bucket(bucketName).build());
});
envContext.closeable(() -> {
LOG.info("Deleting objects from bucket bucket " + bucketName);
final ListObjectsResponse objects = s3Client.listObjects(
ListObjectsRequest.builder()
.bucket(bucketName)
Expand Down

0 comments on commit 329cd02

Please sign in to comment.