Skip to content

Commit

Permalink
draft: system tests working in node 21 with noop
Browse files Browse the repository at this point in the history
  • Loading branch information
aabmass committed Feb 2, 2024
1 parent dead429 commit 912ba18
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions system-test/busybench-js/src/busybench.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@ const testArr = [];
* It continues to do this until durationSeconds after the startTime.
*/
function busyLoop(durationSeconds) {
const noop = () => {};
for (let i = 0; i < testArr.length; i++) {
for (let j = 0; j < testArr[i].length; j++) {
testArr[i][j] = Math.sqrt(j * testArr[i][j]);
noop();
}
}
if (Date.now() - startTime < 1000 * durationSeconds) {
Expand Down
2 changes: 2 additions & 0 deletions system-test/busybench/src/busybench.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@ const testArr: number[][] = [];
* It continues to do this until durationSeconds after the startTime.
*/
function busyLoop(durationSeconds: number) {
const noop = () => {};
for (let i = 0; i < testArr.length; i++) {
for (let j = 0; j < testArr[i].length; j++) {
testArr[i][j] = Math.sqrt(j * testArr[i][j]);
noop();
}
}
if (Date.now() - startTime < 1000 * durationSeconds) {
Expand Down
4 changes: 3 additions & 1 deletion system-test/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,12 @@ fi

node -v
node --trace-warnings "$BENCHPATH" 10 $VERIFY_TIME_LINE_NUMBERS
cp time.pb.gz /src/$(node -v)-time.pb.gz
cp heap.pb.gz /src/$(node -v)-heap.pb.gz

if [[ "$VERIFY_TIME_LINE_NUMBERS" == "true" ]]; then
pprof -lines -top -nodecount=2 time.pb.gz | tee $tty | \
grep "busyLoop.*src/busybench.js:[2-3][08-9]"
grep "busyLoop.*src/busybench.js:[2-3][0-9]"
pprof -filefunctions -top -nodecount=2 heap.pb.gz | tee $tty | \
grep "busyLoop.*src/busybench.js"
else
Expand Down

0 comments on commit 912ba18

Please sign in to comment.