Open Bug 1472299 Opened 7 years ago Updated 2 years ago

Testing an expiring probe is problematic

Categories

(Toolkit :: Telemetry, enhancement, P3)

enhancement

Tracking

()

Tracking Status
firefox63 --- affected

People

(Reporter: chutten, Unassigned)

References

(Blocks 1 open bug)

Details

We encourage people to write tests to ensure their probes don't break when the code changes around them, but we don't make it terribly easy. One case is expiring probes. Services.telemetry.scalarSet('my.scalar', 55) will act the same whether 'my.scalar' is a scalar defined in this build or not, if 'my.scalar' is a scalar present in this build but is expired, and if 'my.scalar' is present and unexpired and whose value can then be expected to be present in a snapshot. So, something like Services.telemetry.isScalarDefined(scalarName); Services.telemetry.isScalarExpired(scalarName); or something like let scalarInfo = Services.telemetry.getScalarInfo(scalarName); if (scalarInfo && !scalarInfo.expired) { Assert.equal(scalarInfo.value, 55); }
Instead of this specific solution, could we just continue recording expired probes, but not send them? That would not require any changes to test code at all.
Summary: Provide some mechanism to query if a probe is defined/unexpired → Testing an expiring probe is problematic
Priority: -- → P3
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.