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

test(s3stream): add objectStorage rangeRead test #1423

Merged
merged 8 commits into from
Jun 18, 2024

Conversation

warr99
Copy link
Contributor

@warr99 warr99 commented Jun 14, 2024

  • Add AbstractObjectStorage close method
  • rangeRead test

abstract void doRangeRead(String path, long start, long end, CompletableFuture<ByteBuf> cf, Consumer<Throwable> failHandler, Consumer<CompositeByteBuf> successHandler);

abstract boolean isUnrecoverable(Throwable ex);

abstract void objectStorageClose();
Copy link
Collaborator

@superhx superhx Jun 17, 2024

Choose a reason for hiding this comment

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

objectStorageClose => close0 or doClose



@Tag("S3Unit")
class ObjectStorageTest {
Copy link
Collaborator

Choose a reason for hiding this comment

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

It should be AbstractObjectStrorageTest, and implement a mock AbstractObjectStorage

@@ -89,6 +89,19 @@ public AbstractObjectStorage(
S3StreamMetricsManager.registerInflightS3WriteQuotaSupplier(inflightWriteLimiter::availablePermits, currentIndex);
}

// used for test only
public AbstractObjectStorage(boolean manualMergeRead) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Prefer use a single base constructor and create a test constructor based on it. If there are many arguments in constructor, we could also use builder mode

@superhx superhx merged commit 5ac9b18 into main Jun 18, 2024
7 checks passed
@superhx superhx deleted the test/aws-object-storage-range-read-test branch June 18, 2024 02:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants