-
Notifications
You must be signed in to change notification settings - Fork 94
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
Fix bad bucketname in storage usage. #800
Fix bad bucketname in storage usage. #800
Conversation
?assertEqual(ok, erlcloud_s3:create_bucket(Bucket, UserConfig)), | ||
%% Put 100-byte object | ||
Block = crypto:rand_bytes(100), | ||
_ = erlcloud_s3:put_object(Bucket, ?KEY, Block, UserConfig), |
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.
Let's verify this function returns [{version_id,"null"}]
.
|
@@ -61,7 +61,7 @@ sum_user(Riak, User) when is_list(User) -> | |||
{string(), term()|string()}. | |||
maybe_sum_bucket(Riak, User, Bucket) -> | |||
case sum_bucket(Riak, Bucket) of | |||
{struct, _} = BucketUsage -> BucketUsage; | |||
{struct, _} = BucketUsage -> {Bucket, BucketUsage}; |
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.
Any ideas why dialyzer didn't catch this before?
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.
See #759, probably I didn't run dialyzer after fixing this function's spec. Maybe current spec notation is too loose, so more strict type/spec setting may improve safety.
Too late to wait for r_t finish, will resume tomorrow or next Monday. |
confirm() -> | ||
Config = [{riak, rtcs:riak_config()}, {stanchion, rtcs:stanchion_config()}, | ||
{cs, rtcs:cs_config([{fold_objects_for_list_keys, true}])}], | ||
{UserConfig, {_RiakNodes, _CSNodes, _Stanchion}} = rtcs:setup(4, Config), |
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.
I recommend rtcs:setup(1, Config)
for shorter startup/teardown time.
Code seems obvious and good, while dialyzer's behaviour still seems weird. This is a good change to refine type/spec notations around |
Thank you for the comments. I updated lines and also executed the kota's code formatter to |
+1 |
…ge-stats Fix bad bucketname in storage usage.
This fixes the bug that bucket names in storage usage are wrong.
Bug report: #797