fix(node:os): return CPU info shape - #1897
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
os.cpus()runtime stub with Node-shaped CPU info objectsmodel,speed, and nestedtimes.{user,nice,sys,idle,irq}fields/proc/cpufreq data when available and a shape-compatible available-parallelism fallback elsewhereBefore
./run_parity_tests.sh --suite node-suite --module os --filter loadavg-and-cpus-shapefailed because Perry returned an emptyos.cpus()array, so the first CPU field-shape line was missing.Verification
cargo fmt --all --checkcargo check -p perry-runtime./scripts/check_file_size.sh./scripts/regen_api_docs.sh(no docs diff)git diff --check./run_parity_tests.sh --suite node-suite --module os --filter loadavg-and-cpus-shape./run_parity_tests.sh --suite node-suite --module os --filter cpus(2/2 pass)./run_parity_tests.sh --suite node-suite --module os --filter platform(5/5 pass)./run_parity_tests.sh --suite node-suite --module os(34 pass / 5 unrelated fail)Reference
Non-goals
os.networkInterfaces()address entry shapeos.getPriority()/os.setPriority()(covered separately by fix(node:os): add priority methods #1892)os.devNullstring-property method lowering (covered separately by fix(node:os): treat string constants as value method receivers #1890)os.constantsidentity (covered separately by fix(node:os): stabilize constants namespace identity #1887)os.userInfo({ encoding: "buffer" })(covered separately by fix(node:os): return buffers for userInfo buffer encoding #1884)Closes #793
Refs #800