GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test: deflake test-worker-eventlooputil · nodejs/node@8554feb

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • test/sequential
    • test-worker-eventlooputil.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/sequential/test-worker-eventlooputil.js‎

Copy file name to clipboardExpand all lines: test/sequential/test-worker-eventlooputil.js
+7-1Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,19 @@ function checkWorkerIdle(wElu) {
9595
}
9696

9797
function checkWorkerActive() {
98+
// Reading the worker's ELU from this thread is not atomic: the worker's idle
99+
// time is read before the current time. If this thread stalls between the
100+
// two reads while the worker is idle, the stall is counted as worker active
101+
// time in `w` and then missing from `w2`. The duration of the call bounds it.
102+
const start = performance.now();
98103
const w = workerELU();
104+
const skew = performance.now() - start;
99105

100106
metricsCh.port2.postMessage({ cmd: 'spin', dur: 50 });
101107
metricsCh.port2.once('message', mustCall((wElu) => {
102108
const w2 = workerELU(w);
103109

104-
assert.ok(w2.active >= 50, `${w2.active} < 50`);
110+
assert.ok(w2.active >= 50 - skew, `${w2.active} < 50 - ${skew}`);
105111
assert.ok(wElu.active >= 50, `${wElu.active} < 50`);
106112
assert.ok(idleActive(wElu) < idleActive(w2),
107113
`${idleActive(wElu)} >= ${idleActive(w2)}`);

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.