Commit ee333c9
test: deflake test-perf-hooks-timerify-histogram-sync
The previous busy loop wasn't robust enough in making sure
that the function runs for more than 1 nanosecond - and when it
runs faster than that on a fast machine, it measures to 0 for
nanosecond precision and throws a RangeErorr as histogram.record()
only takes positive values. Update it to use Atomics.wait() to
make sure that the function being measured runs for at least
1 millisecond so that the histogram always records a positive value.
PR-URL: #60639
Fixes: #60638
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>1 parent a61e5d8 commit ee333c9Copy full SHA for ee333c9
File tree
Expand file treeCollapse file tree
3 files changed
+15
-9
lines changedOpen diff view settings
Filter options
- test
- common
- parallel
Expand file treeCollapse file tree
3 files changed
+15
-9
lines changedOpen diff view settings
Collapse file
+7Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
931 | 931 | |
932 | 932 | |
933 | 933 | |
| 934 | + |
| 935 | + |
| 936 | + |
| 937 | + |
| 938 | + |
| 939 | + |
934 | 940 | |
935 | 941 | |
936 | 942 | |
| ||
982 | 988 | |
983 | 989 | |
984 | 990 | |
| 991 | + |
985 | 992 | |
986 | 993 | |
987 | 994 | |
|
Collapse file
+2Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
50 | 50 | |
51 | 51 | |
52 | 52 | |
| 53 | + |
53 | 54 | |
54 | 55 | |
55 | 56 | |
| ||
103 | 104 | |
104 | 105 | |
105 | 106 | |
| 107 | + |
106 | 108 | |
Collapse file
test/parallel/test-perf-hooks-timerify-histogram-sync.mjs
Copy file name to clipboard+6-9Lines changed: 6 additions & 9 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
1 | 1 | |
2 | 2 | |
3 | | - |
| 3 | + |
4 | 4 | |
5 | 5 | |
6 | | - |
7 | | - |
8 | | - |
9 | 6 | |
10 | 7 | |
11 | | - |
12 | | - |
13 | | - |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | + |
14 | 13 | |
15 | 14 | |
16 | 15 | |
17 | 16 | |
18 | 17 | |
19 | | - |
20 | 18 | |
21 | | - |
22 | 19 | |
0 commit comments