-
Notifications
You must be signed in to change notification settings - Fork 511
db: add tests for EstimateDiskUsage #5265
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
db: add tests for EstimateDiskUsage #5265
Conversation
6f5050d
to
e380391
Compare
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.
@jbowens reviewed 6 of 7 files at r1, all commit messages.
Reviewable status: 6 of 7 files reviewed, 2 unresolved discussions (waiting on @xxmplus)
disk_usage_test.go
line 155 at r1 (raw file):
case "zero": require.Equal(t, uint64(0), total) case "non-zero":
rather than just expecting zero or nonzero, can we include an explicit value in the test results? It'll help catch instances where the calculated size changes unexpected/unintentionally.
metamorphic/generator.go
line 418 at r1 (raw file):
} func (g *generator) dbEstimateDiskUsage() {
nice
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.
Reviewable status: 6 of 7 files reviewed, 2 unresolved discussions (waiting on @jbowens, @Sachuman, and @xxmplus)
disk_usage_test.go
line 155 at r1 (raw file):
Previously, jbowens (Jackson Owens) wrote…
rather than just expecting zero or nonzero, can we include an explicit value in the test results? It'll help catch instances where the calculated size changes unexpected/unintentionally.
+1 We'll probably need to set DisableAutomaticCompactions
in the options.
bf8e0f6
to
082611f
Compare
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.
Reviewable status: 5 of 7 files reviewed, 2 unresolved discussions (waiting on @jbowens and @xxmplus)
disk_usage_test.go
line 155 at r1 (raw file):
Previously, RaduBerinde wrote…
+1 We'll probably need to set
DisableAutomaticCompactions
in the options.
Seems like even after DisableAutomaticCompactions set, for ingest-external, there is non-determinism for the size,
So I added the expect parameter as optional.
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.
Reviewable status: 5 of 7 files reviewed, 2 unresolved discussions (waiting on @jbowens, @Sachuman, and @xxmplus)
disk_usage_test.go
line 155 at r1 (raw file):
Previously, Sachuman (Sachin) wrote…
Seems like even after DisableAutomaticCompactions set, for ingest-external, there is non-determinism for the size,
So I added the expect parameter as optional.
There are other tests that use ingestions and are deterministic. I think we need to specify the block sizes to avoid the randomization in runBuildRemoteCmd
If it still doesn't work, instead of expect-total
you can add a flag that changes any non-zero value to a special <non-zero>
string when outputting (so we can continue to rely on matching test output)
Added tests for EstimateDiskUsage and EstimateDiskUsageByBackingType. Added calls to metamorphic tests, not for results but for races/panics
082611f
to
5eb27bf
Compare
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.
Reviewable status: 5 of 7 files reviewed, 2 unresolved discussions (waiting on @jbowens and @xxmplus)
disk_usage_test.go
line 155 at r1 (raw file):
Previously, RaduBerinde wrote…
There are other tests that use ingestions and are deterministic. I think we need to specify the block sizes to avoid the randomization in
runBuildRemoteCmd
If it still doesn't work, instead of
expect-total
you can add a flag that changes any non-zero value to a special<non-zero>
string when outputting (so we can continue to rely on matching test output)
Specifying the block size worked, I did not realize it was random there. Thanks
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.
Reviewable status: 5 of 7 files reviewed, 2 unresolved discussions (waiting on @Sachuman and @xxmplus)
TFTRs! |
Added tests for EstimateDiskUsage and EstimateDiskUsageByBackingType.
Added calls to metamorphic tests, not for results but for races/panics.
Implements #5235