$ git clone https://github.com/loynoir/reproduce-deasync-158.js
$ npm install
$ npm test
Actual
$ reproduce_deasync_158_cpu=1 pnpm test
... // No output, 100% CPU.
$ unset reproduce_deasync_158_cpu
$ npm test
index.cjs waiting for ./index.mjs
plugin.cjs waiting for ./dependency.mjs
plugin.cjs waiting for ./dependency.mjs
plugin.cjs waiting for ./dependency.mjs
plugin.cjs waiting for ./dependency.mjs
plugin.cjs waiting for ./dependency.mjs
plugin.cjs waiting for ./dependency.mjs
plugin.cjs waiting for ./dependency.mjs
plugin.cjs waiting for ./dependency.mjs
plugin.cjs waiting for ./dependency.mjs
... // endless
What
deasync.loopWhile
cause endless loop + 100% CPU.deasync.sleep
cause endless loop.Reproduce
https://github.com/loynoir/reproduce-deasync-158.js
Reproduce
Actual
Expected
No endlessloop. No 100% CPU.