Skip to content

Commit

Permalink
Merge #106356
Browse files Browse the repository at this point in the history
106356: tenantcostclient: unskip TestEstimateQueryRUConsumption r=yuzefovich a=yuzefovich

This commit unskips `TestEstimateQueryRUConsumption` by only skipping it under stress and / or race and increasing the delta from 0.25 to 0.75. I stressed this test on otherwise-idle gceworker, and got one flake with 0.5 delta after 6 minutes but no failures with 0.75 delta over 30 minutes.

Fixes: #106350.

Release note: None

Co-authored-by: Yahor Yuzefovich <[email protected]>
  • Loading branch information
craig[bot] and yuzefovich committed Jul 7, 2023
2 parents 5aeb360 + 32a254e commit 1137aee
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@ func TestEstimateQueryRUConsumption(t *testing.T) {
defer log.Scope(t).Close(t)

// This test becomes flaky when the machine/cluster is under significant
// background load, so it should only be run manually.
skip.IgnoreLint(t, "intended to be manually run as a sanity test")
// background load, so we disable running it under stress and/or race.
skip.UnderStress(t)
skip.UnderRace(t)

ctx := context.Background()

Expand Down Expand Up @@ -182,7 +183,12 @@ func TestEstimateQueryRUConsumption(t *testing.T) {
// Check the estimated RU aggregate for all the queries against the actual
// measured RU consumption for the tenant.
tenantMeasuredRUs = getTenantRUs() - tenantStartRUs
const deltaFraction = 0.25
// Usually, the difference is within 0.25 delta, but in rare cases it can be
// outside of that delta (when ran on the gceworker, it was outside the 0.5
// delta within 6 minutes of stressing), so we allow for generous 0.75
// delta. This still provides a good enough sanity check for the RU
// estimation.
const deltaFraction = 0.75
allowedDelta := tenantMeasuredRUs * deltaFraction
require.InDeltaf(t, tenantMeasuredRUs, tenantEstimatedRUs, allowedDelta,
"estimated RUs (%d) were not within %f RUs of the expected value (%f)",
Expand Down

0 comments on commit 1137aee

Please sign in to comment.