-
Notifications
You must be signed in to change notification settings - Fork 55
chore: cleanup presign tests #546
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
Conversation
|
A new generated diff is ready to view: __generated-main...__generated-fix-presign-tests |
| client.listObjectsV2Paginated { bucket = bucketName } | ||
| .flatMapConcat { it.contents?.asFlow() ?: flowOf() } | ||
| .collect { obj -> | ||
| val job = scope.launch(dispatcher) { | ||
| client.deleteObject { | ||
| bucket = bucketName | ||
| key = obj.key | ||
| } | ||
| } | ||
| jobs.add(job) | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Not sure how many objects are being deleted but it would be more efficient to delete them in batches:
client.listObjectsV2Paginated { bucket = bucketName }
.map { page ->
DeleteObjectsRequest {
bucket = bucketName
delete {
objects = page.contents!!.map { obj ->
ObjectIdentifier { key = obj.key }
}
}
}
}
.map { req -> scope.launch { s3.deleteObjects(req) } }
.toList()
.joinAll()| do { | ||
| val bucketExists = try { | ||
| client.headBucket { bucket = testBucket } | ||
| true | ||
| } catch (ex: NotFound) { | ||
| delay(300) | ||
| false | ||
| } | ||
| } while (!bucketExists) | ||
| client.waitUntilBucketExists { bucket = testBucket } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment: Nice!
|
Kudos, SonarCloud Quality Gate passed!
|
|
A new generated diff is ready to view: __generated-main...__generated-fix-presign-tests |








Speedup presign tests and bucket deletion by order of magnitude + misc cleanup