Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: EXC-1878: Add failed stable memory grow tests #3932

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

berestovskyy
Copy link
Contributor

Failed memory growth operations finish in just a few milliseconds, so 10k seems like a safe assertion.

Failed memory growth operations finish in just a few milliseconds,
so 10k seems like a safe assertion.
@github-actions github-actions bot added the test label Feb 13, 2025
@berestovskyy berestovskyy marked this pull request as ready for review February 13, 2025 10:02
@berestovskyy berestovskyy requested a review from a team as a code owner February 13, 2025 10:02

#[test]
fn failed_stable_memory_grow_cost_and_time_single_canister() {
const NUM_WASM_PAGES: u64 = 116 * 1024 * MIB / 65_536;
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Maybe you can use
ic_replicated_state::canister_state::WASM_PAGE_SIZE_IN_BYTES instead of 65_536. There is as well const GiB. The same applies for the test below

.build(),
);
let elapsed_ms = timer.elapsed().as_millis();
let cycles_m = (initial_balance - env.cycle_balance(canister_id)) / 1000 / 1000;
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the reason for keeping track of spent cycles when they are only used to print messages when a test fails? The same applies to the test below.

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

Successfully merging this pull request may close these issues.

2 participants