Commit d0705bd
timers: truncate decimal values
Reverts some timers behavior back to as it was before
2930bd1
That commit introduced an unintended change which allowed non-integer
timeouts to actually exist since the value is no longer converted to an
integer via a TimeWrap handle directly.
Even with the fix in
e9de435
non-integer timeouts are still indeterministic, because libuv does not
support them.
This fixes the issue by emulating the old behavior:
truncate the `_idleTimeout` before using it.
See comments in
#24214
for more background on this.
PR-URL: #24819
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>1 parent edc9ceb commit d0705bdCopy full SHA for d0705bd
File tree
Expand file treeCollapse file tree
3 files changed
+44
-4
lines changedOpen diff view settings
Filter options
- doc/api
- lib
- test/parallel
Expand file treeCollapse file tree
3 files changed
+44
-4
lines changedOpen diff view settings
Collapse file
+2-2Lines changed: 2 additions & 2 deletions
- Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
186 | 186 | |
187 | 187 | |
188 | 188 | |
189 | | - |
| 189 | + |
190 | 190 | |
191 | 191 | |
192 | 192 | |
| ||
209 | 209 | |
210 | 210 | |
211 | 211 | |
212 | | - |
| 212 | + |
213 | 213 | |
214 | 214 | |
215 | 215 | |
|
Collapse file
+7-2Lines changed: 7 additions & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
193 | 193 | |
194 | 194 | |
195 | 195 | |
196 | | - |
| 196 | + |
197 | 197 | |
198 | 198 | |
199 | 199 | |
| 200 | + |
| 201 | + |
| 202 | + |
200 | 203 | |
201 | 204 | |
202 | 205 | |
| ||
378 | 381 | |
379 | 382 | |
380 | 383 | |
381 | | - |
| 384 | + |
| 385 | + |
| 386 | + |
382 | 387 | |
383 | 388 | |
384 | 389 | |
|
Collapse file
test/parallel/test-timers-non-integer-delay.js
Copy file name to clipboardExpand all lines: test/parallel/test-timers-non-integer-delay.js+35Lines changed: 35 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
21 | 21 | |
22 | 22 | |
23 | 23 | |
| 24 | + |
24 | 25 | |
25 | 26 | |
26 | 27 | |
| ||
47 | 48 | |
48 | 49 | |
49 | 50 | |
| 51 | + |
| 52 | + |
| 53 | + |
| 54 | + |
| 55 | + |
| 56 | + |
| 57 | + |
| 58 | + |
| 59 | + |
| 60 | + |
| 61 | + |
| 62 | + |
| 63 | + |
| 64 | + |
| 65 | + |
| 66 | + |
| 67 | + |
| 68 | + |
| 69 | + |
| 70 | + |
| 71 | + |
| 72 | + |
| 73 | + |
| 74 | + |
| 75 | + |
| 76 | + |
| 77 | + |
| 78 | + |
| 79 | + |
| 80 | + |
| 81 | + |
| 82 | + |
| 83 | + |
| 84 | + |
0 commit comments