Skip to content

Commit 477a699

Browse files
Weaken assertion around vCPU startup time: >=0, not >0
As the comment says, if we're doing _well_ we may have not accumulated a full millisecond of startup time.
1 parent 00dcc2c commit 477a699

File tree

1 file changed

+3
-1
lines changed
  • integration-tests/js-compute/fixtures/app/src

1 file changed

+3
-1
lines changed

integration-tests/js-compute/fixtures/app/src/compute.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ import { purgeSurrogateKey, vCpuTime } from 'fastly:compute';
55
routes.set('/compute/get-vcpu-ms', () => {
66
const cpuTime = vCpuTime();
77
strictEqual(typeof cpuTime, 'number');
8-
ok(cpuTime > 0, 'cpuTime > 0');
8+
// We can't assert > 0; this only claims millisecond resolution,
9+
// and we hopefully spent less than 500us starting.
10+
ok(cpuTime >= 0, 'cpuTime > 0');
911
ok(cpuTime < 3000, 'cputime < 3000');
1012
const arr = new Array(100_000).fill(1);
1113
for (let j = 1; j < 100; j++) {

0 commit comments

Comments
 (0)