Skip to content

test(allocator): increase test coverage for Arena::allocated_bytes#21770

Merged
graphite-app[bot] merged 1 commit intomainfrom
om/04-25-test_allocator_increase_test_coverage_for_arena_allocated_bytes_
Apr 26, 2026
Merged

test(allocator): increase test coverage for Arena::allocated_bytes#21770
graphite-app[bot] merged 1 commit intomainfrom
om/04-25-test_allocator_increase_test_coverage_for_arena_allocated_bytes_

Conversation

@overlookmotel
Copy link
Copy Markdown
Member

@overlookmotel overlookmotel commented Apr 26, 2026

Add more test coverage for Arena::allocated_bytes.

Copy link
Copy Markdown
Member Author

overlookmotel commented Apr 26, 2026


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent changes, fast-track this PR to the front of the merge queue

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Apr 26, 2026

Merging this PR will not alter performance

✅ 48 untouched benchmarks
⏩ 3 skipped benchmarks1


Comparing om/04-25-test_allocator_increase_test_coverage_for_arena_allocated_bytes_ (5199c89) with om/04-25-test_allocator_reformat_comments (82aad73)

Open in CodSpeed

Footnotes

  1. 3 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@overlookmotel overlookmotel marked this pull request as ready for review April 26, 2026 11:53
Copilot AI review requested due to automatic review settings April 26, 2026 11:53
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR increases allocator test coverage by expanding assertions around Arena::allocated_bytes() as the arena grows and resets, ensuring the reported totals match expected chunk sizing behavior.

Changes:

  • Extend allocated_bytes unit test to cover empty arena, single-chunk reset behavior, and in-chunk allocations.
  • Add coverage for multi-chunk growth (2nd/3rd chunk creation) and verify reset() deallocates older chunks while retaining the most recent chunk.
  • Add a helper to count allocated chunks via iter_allocated_chunks() and assert chunk counts alongside byte totals.

Comment thread crates/oxc_allocator/src/arena/tests.rs Outdated
@graphite-app
Copy link
Copy Markdown
Contributor

graphite-app Bot commented Apr 26, 2026

Merge activity

…21770)

Add more test coverage for `Arena::allocated_bytes`.
@graphite-app graphite-app Bot force-pushed the om/04-25-test_allocator_reformat_comments branch from ab5c180 to 82aad73 Compare April 26, 2026 21:47
@graphite-app graphite-app Bot force-pushed the om/04-25-test_allocator_increase_test_coverage_for_arena_allocated_bytes_ branch from b0920c8 to 5199c89 Compare April 26, 2026 21:48
Base automatically changed from om/04-25-test_allocator_reformat_comments to main April 26, 2026 22:00
@graphite-app graphite-app Bot merged commit 5199c89 into main Apr 26, 2026
38 checks passed
@graphite-app graphite-app Bot deleted the om/04-25-test_allocator_increase_test_coverage_for_arena_allocated_bytes_ branch April 26, 2026 22:01
@overlookmotel overlookmotel added C-test Category - Testing. Code is missing test cases, or a PR is adding them A-allocator Area - Allocator labels Apr 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-allocator Area - Allocator C-test Category - Testing. Code is missing test cases, or a PR is adding them

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants