Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AssertionError in cpu-profiler.js Test on x64 UBI 9.3 Container for Isolated-VM Build #505

Open
pooja0805 opened this issue Nov 4, 2024 · 3 comments

Comments

@pooja0805
Copy link

Hello Team,

I attempted to build and test the isolated-vm library on an x64 UBI 9.3 container, but encountered the following error during the cpu-profiler.js test:

cpu-profiler.js: *fail*
code: 1 signal: null
stderr: node:internal/process/promises:394
    triggerUncaughtException(err, true /* fromPromise */);
    ^

AssertionError [ERR_ASSERTION]: profiles should have length > 0
    at testAsync (/home/test/isolated-vm/tests/cpu-profiler.js:98:9)
    at async Promise.all (index 2) {
  generatedMessage: false,
  code: 'ERR_ASSERTION',
  actual: false,
  expected: true,
  operator: '=='
}

Node.js v22.10.0

Observed Behavior:

The test failed with an assertion error indicating "profiles should have length > 0".

Expected Behavior:

The cpu-profiler.js test should pass as it does when run in an Ubuntu container.

Steps to Reproduce the Error:

  1. Install required packages:
sudo yum install -y wget tar git gzip gcc gcc-c++ make python3 python3-devel
  1. Install Node.js v22.10.0:
NODE_VERSION=22.10.0 && wget -q https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64.tar.gz && tar -xzf node-v$NODE_VERSION-linux-x64.tar.gz && export PATH=$HOME/node-v$NODE_VERSION-linux-x64/bin:$PATH && node -v
  1. Clone and enter the isolated-vm repository:
git clone -b 'v5.0.1' https://github.com/laverdet/isolated-vm.git && cd isolated-vm
  1. Install dependencies:
npm install
  1. Run tests:
npm test

Additional Information:

The test passes when running the same steps in an Ubuntu container. Please guide on resolving this issue in the UBI 9.3 environment.

Thanks.

@laverdet
Copy link
Owner

laverdet commented Nov 4, 2024

Could you try increasing the 2048 constant in the test suite? The CPU profiler is a sampler so it could just be that it is running with a lower sample rate for some reason

@pooja0805
Copy link
Author

Could you try increasing the 2048 constant in the test suite? The CPU profiler is a sampler so it could just be that it is running with a lower sample rate for some reason

@laverdet Thanks for the suggestion. I did try increasing the 2048 constant in the test suite to 4096 and it is now passing.

@pooja0805
Copy link
Author

@laverdet I was trying to build and test isolated-vm on UBI 9.3 ppc64le VM as well and encountered the same error as seen on x64 arch.

I tried increasing the 2048 constant in the test suite on ppc64le, but the error persists. I experimented with values of 4096, 8192, 16384, and 32768, but unfortunately, none of these changes resolved the issue. The profiler still fails to gather sufficient data, resulting in the same "profiles should have length > 0" assertion error.

If there are any additional suggestions for adjusting the sampling rate or profiling settings, I'd be happy to try them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants