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

tests: fix test failure due to os.freemem() behaviour change in node v16.14.0 #2570

Merged
merged 1 commit into from
Feb 10, 2022

Conversation

trentm
Copy link
Member

@trentm trentm commented Feb 10, 2022

The update to libuv 1.43.0 changed the behaviour of os.freemem() on
Linux to report "MemAvailable" from /proc/meminfo rather than "MemFree".

Refs: #2530, #2540

This is the same thing as we have already done for node v18 and v17, respectively, in the two linked PRs. The recently released node v16.14.0 (https://nodejs.org/en/blog/release/v16.14.0/) updated to the libuv with this os.freemem() behaviour change:

…v16.14.0

The update to libuv 1.43.0 changed the behaviour of os.freemem() on
Linux to report "MemAvailable" from /proc/meminfo rather than "MemFree".

Refs: #2530, #2540
@trentm trentm requested a review from astorm February 10, 2022 18:29
@trentm trentm self-assigned this Feb 10, 2022
@github-actions github-actions bot added the agent-nodejs Make available for APM Agents project planning. label Feb 10, 2022
@apmmachine
Copy link
Contributor

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2022-02-10T18:29:30.707+0000

  • Duration: 34 min 12 sec

Test stats 🧪

Test Results
Failed 0
Passed 240407
Skipped 0
Total 240407

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • run module tests for <modules> : Run TAV tests for one or more modules, where <modules> can be either a comma separated list of modules (e.g. memcached,redis) or the string literal ALL to test all modules

  • run benchmark tests : Run the benchmark test only.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@trentm trentm merged commit e29269b into main Feb 10, 2022
@trentm trentm deleted the trentm/fix-node16.14.0-test-os.freemem branch February 10, 2022 20:21
@trentm
Copy link
Member Author

trentm commented Feb 10, 2022

The test failure on "main" that led to this:

https://apm-ci.elastic.co/blue/organizations/jenkins/apm-agent-nodejs%2Fapm-agent-nodejs-mbp/detail/main/39/pipeline

[2022-02-10T06:17:59.323Z] node_tests_1     | running test: cd . && node --unhandled-rejections=strict test/metrics/index.test.js > test_output/test-metrics-index.test.js.tap 2&>1
...
[2022-02-10T06:17:59.585Z] node_tests_1     | # system.memory.actual.free
[2022-02-10T06:17:59.585Z] node_tests_1     | ok 74 is present
[2022-02-10T06:17:59.585Z] node_tests_1     | ok 75 is a number
[2022-02-10T06:17:59.586Z] node_tests_1     | ok 76 is finite (was: 10904395776)
[2022-02-10T06:17:59.586Z] node_tests_1     | not ok 77 is larger than os.freemem() (value: 10904395776, free: 10904395776)
[2022-02-10T06:17:59.586Z] node_tests_1     |   ---
[2022-02-10T06:17:59.586Z] node_tests_1     |     operator: ok
[2022-02-10T06:17:59.586Z] node_tests_1     |     expected: true
[2022-02-10T06:17:59.586Z] node_tests_1     |     actual:   false
[2022-02-10T06:17:59.586Z] node_tests_1     |     at: Object.system.memory.actual.free (/app/test/metrics/index.test.js:85:13)
[2022-02-10T06:17:59.586Z] node_tests_1     |     stack: |-
[2022-02-10T06:17:59.586Z] node_tests_1     |       Error: is larger than os.freemem() (value: 10904395776,
[2022-02-10T06:17:59.586Z] node_tests_1     |                 free: 10904395776)
[2022-02-10T06:17:59.586Z] node_tests_1     |           at Test.assert [as _assert] (/app/node_modules/tape/lib/test.js:314:54)
[2022-02-10T06:17:59.586Z] node_tests_1     |           at Test.bound [as _assert] (/app/node_modules/tape/lib/test.js:99:32)
[2022-02-10T06:17:59.586Z] node_tests_1     |           at Test.assert (/app/node_modules/tape/lib/test.js:433:10)
[2022-02-10T06:17:59.586Z] node_tests_1     |           at Test.bound [as ok] (/app/node_modules/tape/lib/test.js:99:32)
[2022-02-10T06:17:59.586Z] node_tests_1     |           at Object.system.memory.actual.free (/app/test/metrics/index.test.js:85:13)
[2022-02-10T06:17:59.586Z] node_tests_1     |           at Object.sendMetricSet (/app/test/metrics/index.test.js:144:20)
[2022-02-10T06:17:59.586Z] node_tests_1     |           at /app/lib/metrics/reporter.js:4:1202
[2022-02-10T06:17:59.586Z] node_tests_1     |           at /app/node_modules/after-all-results/index.js:20:25
[2022-02-10T06:17:59.586Z] node_tests_1     |           at processTicksAndRejections (node:internal/process/task_queues:78:11)
[2022-02-10T06:17:59.586Z] node_tests_1     |   ...
[2022-02-10T06:17:59.586Z] node_tests_1     | # system.process.memory.rss.bytes
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agent-nodejs Make available for APM Agents project planning.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants