Skip to content

test(node): cover parse_max_batch_entries invalid inputs - #156

Closed
Kewe63 wants to merge 1 commit into
circlefin:mainfrom
Kewe63:test/max-batch-entries-invalid-input
Closed

Kewe63 wants to merge 1 commit into
circlefin:mainfrom
Kewe63:test/max-batch-entries-invalid-input

Conversation

@Kewe63

@Kewe63 Kewe63 commented Jun 15, 2026

Copy link
Copy Markdown

Overview

The existing test_arc_rpc_max_batch_entries_zero_rejected only exercises the post-parse n == 0 rejection.

The four pre-parse branches of parse_max_batch_entries (non-numeric, negative, overflow, and empty) are currently not pinned. Because of this, clap surfaces the parser's format!("invalid number: {s}") message verbatim to the operator. Any wording change in these paths would leak out to --help output and CI logs without any test catching the regression.

Changes

  • Added dedicated test cases for each of the four pre-parse failure branches (non-numeric, negative, overflow, empty).
  • Introduced a small err_str helper function so the assertion message embeds the actual error string the operator would see, improving debuggability beyond a simple pass/fail.

Verification Results

Automated Checks

  • cargo check -p arc-node-execution --tests -> OK
  • cargo fmt --check -p arc-node-execution -> CLEAN

Testing Note

Note

The full cargo test for this binary OOMs (Out of Memory) in the local 8 GB sandbox before the test binary can link. Full test execution has been deferred to the CI pipeline.

The existing `test_arc_rpc_max_batch_entries_zero_rejected` only
exercises the post-parse `n == 0` rejection. The four pre-parse
branches of `parse_max_batch_entries` — non-numeric, negative,
overflow, empty — are not pinned, and clap surfaces the parser's
`format!("invalid number: {s}")` message verbatim to the
operator. Any wording change there would leak out to
`--help` output and CI logs without any test catching it.

Add one test per branch with a small `err_str` helper so the
assert message embeds the actual error string the operator would
see, not just a pass/fail.

Verified locally with `cargo check -p arc-node-execution --tests`
(1.71s). The full `cargo test` build for this binary OOMs
in the local 8 GB sandbox before the test binary can link, so
test execution is deferred to CI.
@ZhiyuCircle ZhiyuCircle added test Test-only additions EL Component: EL labels Jul 23, 2026
@ZhiyuCircle

Copy link
Copy Markdown
Contributor

Hi @Kewe63,

Thank you for your interest in contributing to Arc Node, and apologies for the delay in getting back to this PR.

We're closing out the pull request backlog that predates our current contribution policy. This PR is being closed because it does not reference a GitHub issue. All PRs must reference an existing issue using the format Closes: #XXX, and the author must be assigned to that issue before the PR is opened.

This is not a judgement on the change itself. If you'd still like to land it:

  1. Open an issue describing the problem, or find the existing one
  2. Comment on the issue requesting assignment, and wait for maintainer approval
  3. Open a fresh PR once you have been assigned

Please see CONTRIBUTING.md for details. Thanks again for taking the time to contribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

EL Component: EL need-triage test Test-only additions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants