Skip to content

test: CON-1681 Extend HTTP outcalls proptest with non-replicated, flexible, and timed out requests#10267

Draft
eichhorl wants to merge 1 commit into
masterfrom
eichhorl/http-outcalls-proptest
Draft

test: CON-1681 Extend HTTP outcalls proptest with non-replicated, flexible, and timed out requests#10267
eichhorl wants to merge 1 commit into
masterfrom
eichhorl/http-outcalls-proptest

Conversation

@eichhorl
Copy link
Copy Markdown
Contributor

No description provided.

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

Extends the canister HTTP payload builder property test to cover additional request replication strategies and timeout behavior, ensuring build→validate roundtrips remain valid across multiple rounds (exercising past-payload dedup).

Changes:

  • Refactors proptest input generation into scenario-based modeling (FullyReplicated, NonReplicated, Flexible) plus timed-out vs non-timed-out request contexts.
  • Adds scenario builders that populate the pool with corresponding shares/content patterns (including divergence-style shares for fully replicated).
  • Increases proptest cases and improves failure diagnostics by printing validation errors.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +27 to +32
/// Validation context time used by the proptest. Picked large enough that
/// requests timestamped at `UNIX_EPOCH` time out (since
/// `CANISTER_HTTP_TIMEOUT_INTERVAL` is 60 seconds), while requests timestamped
/// at `UNIX_EPOCH + NOT_TIMED_OUT_OFFSET_SECS` do not.
const VALIDATION_TIME_SECS: u64 = 200;
const NOT_TIMED_OUT_OFFSET_SECS: u64 = 150;
Comment on lines +363 to +364
/// known callback id) plus a list of additional shares with random callback
/// ids that the payload builder doesn't know about.
Comment on lines +130 to 143
let scenarios: Vec<_> = scenario_inputs
.into_iter()
.enumerate()
.map(|(idx, input)| build_scenario(CallbackId::new(idx as u64 + 1), input))
.collect();

inject_request_contexts(
&mut payload_builder,
all_callback_ids.into_iter().map(|callback_id| {
scenarios.iter().enumerate().map(|(idx, scenario)| {
(
callback_id,
request_context(ic_types::canister_http::Replication::FullyReplicated),
CallbackId::new(idx as u64 + 1),
scenario.request_context.clone(),
)
}),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants