google / pprof-nodejs

pprof support for Node.js
Apache License 2.0
251 stars 26 forks source link

fix: switch away from using "require" in benchmark used in tests #220

Closed nolanmar511 closed 2 years ago

nolanmar511 commented 2 years ago

Before ignoring busybench.js in the linter config, I got the following error after this change:

/usr/local/google/home/nolanmar/pprof-nodejs/system-test/busybench-js/src/busybench.js
  17:1  error  Parsing error: 'import' and 'export' may appear only with 'sourceType: module'

I think since this file uses a separate package.json and contains a javascript file (and "gts" is meant to enforce typescript file), it seems reasonable to ignore it when running gts check for this repo.

Some additional changes were made along the way to make test easier to debug. I did run system_test.sh locally replacing the checks to confirm "busyLoop" appeared in the profile with checks for a different non-existent function and confirmed the test still failed.