Skip to content

[submit] Test coverage gaps: retry, HTTP 429, scheme rejection, hash parsing all untested #202

@obchain

Description

@obchain

Refs #44

File: crates/charon-executor/src/submit.rs (tests)

Problem

Two unit tests cover default timeout value and syntactically invalid URL. Untested:

  1. Timeout retry path (would require tokio::time::pause)
  2. HTTP 429/503 classification — does it currently fall through to Err?
  3. https-only scheme enforcement (after sibling fix lands)
  4. Successful hash parse from JSON-RPC response
  5. Reconnect on dropped connection

Live submission test is deferred per PR description, but the above are testable with httpmock or wiremock without a live endpoint.

Fix

Add httpmock to dev-dependencies. Add tests for each of the five scenarios above. Add tokio::time::pause coverage for the timeout path.

Metadata

Metadata

Assignees

No one assigned

    Labels

    layer:rustRust crates (core / scanner / protocols / executor / cli)pr-reviewFindings from PR review processpriority:p2-polishNice-to-have / polishstatus:readyScoped and ready to pick uptype:testTests, fuzz, fork, integration

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions