test(pm): cover resolver demand mainloop#3049
Draft
elrrrrrrr wants to merge 1 commit into
Draft
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces a comprehensive suite of unit tests for the resolver's manifest fetching and caching logic in crates/ruborist/src/resolver/builder.rs. These tests cover job deduping, priority handling (Demand vs. Prefetch), concurrency limits, and caching behavior for both exact versions and full manifests. A CountingRegistry mock was also added to facilitate tracking of manifest jobs during testing. I have no feedback to provide.
2948997 to
c4361f4
Compare
5acdc80 to
286856e
Compare
c4361f4 to
13bb300
Compare
286856e to
f8cd7ab
Compare
📊 pm-bench-phases ·
|
| PM | wall | ±σ | user | sys | RSS | pgMinor |
|---|---|---|---|---|---|---|
| bun | 7.54s | 0.93s | 10.31s | 6.15s | 669M | 298.8K |
| utoo-next | 7.35s | 1.54s | 10.59s | 7.85s | 984M | 130.4K |
| utoo-npm | 7.51s | 1.45s | 10.84s | 8.07s | 1.01G | 119.7K |
| utoo | 6.78s | 0.13s | 11.47s | 7.90s | 959M | 146.0K |
| PM | vCtx | iCtx | netRX | netTX | cache | node_mod | lock |
|---|---|---|---|---|---|---|---|
| bun | 17.2K | 17.6K | 1.19G | 6M | 1.86G | 1.75G | 1M |
| utoo-next | 138.1K | 93.7K | 1.16G | 5M | 1.71G | 1.70G | 2M |
| utoo-npm | 152.7K | 106.8K | 1.16G | 5M | 1.71G | 1.70G | 2M |
| utoo | 125.4K | 67.7K | 1.16G | 6M | 1.71G | 1.70G | 2M |
p1_resolve
| PM | wall | ±σ | user | sys | RSS | pgMinor |
|---|---|---|---|---|---|---|
| bun | 2.02s | 0.03s | 4.43s | 0.77s | 527M | 165.6K |
| utoo-next | 2.85s | 0.15s | 5.35s | 1.20s | 612M | 87.7K |
| utoo-npm | 2.83s | 0.04s | 5.54s | 1.44s | 617M | 78.6K |
| utoo | 2.24s | 0.07s | 6.11s | 1.15s | 651M | 123.7K |
| PM | vCtx | iCtx | netRX | netTX | cache | node_mod | lock |
|---|---|---|---|---|---|---|---|
| bun | 9.8K | 4.8K | 203M | 3M | 107M | - | 1M |
| utoo-next | 55.3K | 71.8K | 199M | 2M | 7M | 3M | 2M |
| utoo-npm | 80.6K | 92.8K | 200M | 2M | 7M | 3M | 2M |
| utoo | 16.0K | 17.9K | 202M | 3M | 7M | 3M | 2M |
p3_cold_install
| PM | wall | ±σ | user | sys | RSS | pgMinor |
|---|---|---|---|---|---|---|
| bun | 5.34s | 0.13s | 5.89s | 6.08s | 592M | 197.4K |
| utoo-next | 6.29s | 2.06s | 4.91s | 6.91s | 540M | 60.5K |
| utoo-npm | 6.77s | 2.52s | 4.98s | 6.92s | 529M | 64.1K |
| utoo | 4.82s | 0.40s | 4.91s | 6.78s | 474M | 62.2K |
| PM | vCtx | iCtx | netRX | netTX | cache | node_mod | lock |
|---|---|---|---|---|---|---|---|
| bun | 6.3K | 6.2K | 1019M | 4M | 1.76G | 1.76G | 1M |
| utoo-next | 126.1K | 53.5K | 990M | 3M | 1.70G | 1.70G | 2M |
| utoo-npm | 131.4K | 47.2K | 990M | 4M | 1.70G | 1.70G | 2M |
| utoo | 119.7K | 49.8K | 989M | 3M | 1.70G | 1.70G | 2M |
p4_warm_link
| PM | wall | ±σ | user | sys | RSS | pgMinor |
|---|---|---|---|---|---|---|
| bun | 2.11s | 0.05s | 0.14s | 1.17s | 134M | 32.8K |
| utoo-next | 1.84s | 0.03s | 0.48s | 2.33s | 78M | 18.4K |
| utoo-npm | 1.80s | 0.09s | 0.48s | 2.35s | 79M | 18.4K |
| utoo | 1.90s | 0.25s | 0.48s | 2.32s | 79M | 18.7K |
| PM | vCtx | iCtx | netRX | netTX | cache | node_mod | lock |
|---|---|---|---|---|---|---|---|
| bun | 238 | 15 | 5M | 19K | 1.91G | 1.75G | 1M |
| utoo-next | 42.1K | 18.6K | 7K | 11K | 1.70G | 1.70G | 2M |
| utoo-npm | 42.7K | 18.3K | 4K | 9K | 1.70G | 1.70G | 2M |
| utoo | 42.7K | 17.9K | 2K | 5K | 1.71G | 1.70G | 2M |
npmmirror.com: no output captured.
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
Validation
cargo fmtcargo check -p utoo-ruboristcargo test -p utoo-ruborist resolver::builder::tests::test_fetch_queues -- --nocapturecargo test -p utoo-ruborist resolver::builder::tests::test_apply_fetch_result -- --nocapturecargo test -p utoo-ruborist resolver::builder::tests::test_non_semver_exact_version_extract_single_flight -- --nocapturecargo test -p utoo-ruborist resolver::builder::tests::test_enqueue_version -- --nocapturecargo test -p utoo-ruborist resolver::builder::tests::test_schedule_registry_fetch_dedupes_semver_request -- --nocapturecargo clippy --all-targets -- -D warnings --no-depsSplit Plan
This is split out of #3043 so the behavior switch PR stays focused on implementation while the detailed demand-mainloop coverage is reviewed separately.