test: CON-1681 Extend HTTP outcalls proptest with non-replicated, flexible, and timed out requests#10267
Draft
eichhorl wants to merge 1 commit into
Draft
test: CON-1681 Extend HTTP outcalls proptest with non-replicated, flexible, and timed out requests#10267eichhorl wants to merge 1 commit into
eichhorl wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
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(), | ||
| ) | ||
| }), |
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.
No description provided.