Skip to content

Commit

Permalink
test: clarify [0,1] range for system.cpu.utilization metric test
Browse files Browse the repository at this point in the history
The <=1 should fix flakiness. The <=0 test might make this flaky again.

Refs: #73
  • Loading branch information
trentm committed Mar 14, 2024
1 parent df99425 commit 1dc577a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/opentelemetry-node/test/host-metrics.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ const testFixtures = [
'data points are present in system.cpu.utilization metric'
);
const allInRange = metric.gauge?.dataPoints.every(
(dp) => dp.asDouble < 1
(dp) => 0 <= dp.asDouble && dp.asDouble <= 1
);
t.ok(
allInRange,
'"system.cpu.utilization" data points have a value between 0-1'
'"system.cpu.utilization" data points are in the range [0,1]'
);
if (!allInRange) {
// Note: extra output to debug flaky test (https://github.com/elastic/elastic-otel-node/issues/73).
Expand Down

0 comments on commit 1dc577a

Please sign in to comment.