-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
test: correct test-worker-eventlooputil #35891
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,9 +34,10 @@ function workerOnMetricsMsg(msg) { | |
| } | ||
|
|
||
| if (msg.cmd === 'spin') { | ||
| const elu = eventLoopUtilization(); | ||
| const t = now(); | ||
| while (now() - t < msg.dur); | ||
| return this.postMessage(eventLoopUtilization()); | ||
| return this.postMessage(eventLoopUtilization(elu)); | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -68,8 +69,8 @@ let workerELU; | |
|
|
||
|
|
||
| function checkWorkerIdle(wElu) { | ||
| const tmpMainElu = eventLoopUtilization(mainElu); | ||
| const perfWorkerElu = workerELU(); | ||
| const tmpMainElu = eventLoopUtilization(mainElu); | ||
| const eluDiff = eventLoopUtilization(perfWorkerElu, mainElu); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Completely remove the
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done. We could add |
||
|
|
||
| assert.strictEqual(idleActive(eluDiff), | ||
|
|
@@ -104,8 +105,9 @@ function checkWorkerActive() { | |
| const w2 = workerELU(w); | ||
|
|
||
| assert.ok(w2.active >= 50, `${w2.active} < 50`); | ||
| assert.ok(idleActive(wElu) > idleActive(w2), | ||
| `${idleActive(wElu)} <= ${idleActive(w2)}`); | ||
| assert.ok(wElu.active >= 50, `${wElu.active} < 50`); | ||
| assert.ok(idleActive(wElu) < idleActive(w2), | ||
|
Flarna marked this conversation as resolved.
|
||
| `${idleActive(wElu)} => ${idleActive(w2)}`); | ||
|
Flarna marked this conversation as resolved.
Outdated
|
||
|
|
||
| metricsCh.port2.postMessage({ cmd: 'close' }); | ||
| }); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.