[
https://issues.apache.org/jira/browse/HBASE-19712?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16313485#comment-16313485
]
Josh Elser commented on HBASE-19712:
------------------------------------
Thanks for trying to stabilize this, [~chia7712]!
{code}
final AtomicReference<Long> lastSeenSize = new AtomicReference<>();
// Wait for the Master chore to run to see the usage (with a fudge factor)
TEST_UTIL.waitFor(30_000, new SpaceQuotaSnapshotPredicate(conn, tn1) {
+ private final long regionSize =
TEST_UTIL.getMiniHBaseCluster().getRegions(tn1).stream()
+ .flatMap(r ->
r.getStores().stream()).mapToLong(HStore::getHFilesSize).sum();
{code}
What about lifting {{regionSize}} out of the {{Predicate}} and then using
{{regionSize}} instead of {{lastSeenSize}}. Since we can look at the Regions
directly and know exactly what the size should be, we can avoid the "fudge
factor" I was trying to do here. Then, we can just delete {{lastSeenSize}}.
I don't think I ever knew exactly why the size varied slightly -- let me try to
run here to make sure it works for me too.
> Fix TestSnapshotQuotaObserverChore#testSnapshotSize
> ---------------------------------------------------
>
> Key: HBASE-19712
> URL: https://issues.apache.org/jira/browse/HBASE-19712
> Project: HBase
> Issue Type: Bug
> Components: test
> Reporter: Chia-Ping Tsai
> Assignee: Chia-Ping Tsai
> Fix For: 2.0.0-beta-2
>
> Attachments: HBASE-19712.v0.patch
>
>
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)