Repository navigation
Bump PocketIC to 16.0.0 - #9624
Merged
Merged
Conversation
PocketIC 16's replica charges every canister a base fee and prices storage 2.5x higher, and delivers cross-subnet messages after 10 rounds rather than 1. Adapt the integration tests: - Start envs at the current time, since jumping from PocketIC's 2021 genesis to today now drains child canisters of their cycles - Allow for the freezing threshold, now ~26B, in the cycles refunder's residual balance - Tick enough for cross-subnet hops to land where tests wait on them - Enable beta features, ie. the `flexible_http_requests` flag, which is enabled on every mainnet subnet and lets HTTPS outcalls use pay-as-you-go pricing - Use a fresh env where a test sets the clock to the current time, since a pooled env's clock may already be past it Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
hpeebles
requested review from
ivan-jukic,
julianjelfs and
megrogan
as code owners
September 28, 2026 22:13
|
…olation and local canister creation - Tick enough for cross-subnet hops at the remaining sites which assert on the other user's copy - Let the stop/act/start retry tests wait out a cross-subnet round trip before restarting the canister, else the first attempt only lands after the restart and nothing fails - Discard the env after `daily_puzzle_start_submit_and_streak`, whose made up `light_up` puzzle for today otherwise shadows the real one in any later test which draws the env on a day the real puzzle is also `light_up` - Read the default effective canister id from the topology JSON in `local_canister_creator`, since pocket-ic 16's `Topology` can't parse the response of the PocketIC server bundled with dfx Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 tasks done
- `join_private_group_with_invitation_succeeds` and the community broadcast in `invariant_1_only_small_private_groups_ring` waited too few rounds for a cross-subnet hop (both also flake on master for the same reason) - `deposit_refunded_if_swap_expires` jumped the clock a day while the bounded wait call delivering the offer to user2 could still be in flight across subnets, so it passed its deadline and user2 never had the swap to update Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
Bumps PocketIC from 11.0.0 to 16.0.0 (library and server binary) and adapts the integration tests to what changed underneath. This is meant to merge ahead of #9618.
PocketIC 16 doesn't change the library API in any way we use. Its replica, however, is nine months newer, and three of those changes affect the tests.
1. Every canister now pays a base fee, and storage costs 2.5× more
dfinity/ic#10292 charges every canister 10k cycles/s (about 0.86B cycles a day) regardless of what it uses. Storage went from 127,000 to 317,500 cycles per GiB per second (dfinity/ic#9127, #9424, #9752). Both are live on mainnet. Measured idle burn:
This broke tests in two ways:
ensure_time_at_least_day0, the daily puzzle and video call tests), about 5.4 years, which now burns roughly 1.9T from child canisters that start with 0.5T. Those canisters ran out of cycles and were uninstalled. Because envs are pooled, later tests that drew the same env failed too. Fix: envs now start at the current time (with_initial_time), so none of those jumps are needed.cycles_refunder_testsanddelete_user_tests. Fix: raised both limits to 125B and updated the explanation, including the one in the refunder's README.2. Cross-subnet messages take 10 rounds instead of 1
Measured with a direct message between users on different subnets: delivered after exactly 10 ticks, deterministically, versus 1 tick on PocketIC 11. Same-subnet delivery is still immediate. The replica's move to asynchronous state hashing (dfinity/ic#8464) is the likely cause, and PocketIC has no setting for it.
New users go to whichever LocalUserIndex has fewest users. In pooled envs, whether a test's users (and so their chats, groups and communities) share a subnet therefore depends on the tests that ran before it. Fix: raised the ticks wherever a test waits on a cross-subnet hop. Where I measured, I used the measured count plus a margin:
TICKS_FOR_VERIFICATION_TO_PROPAGATEconstant of 20.The slower delivery also affects bounded-wait calls. Jumping the clock (for example by a day, to expire a p2p swap) while such a call is still crossing subnets makes it pass its deadline ("Call deadline has expired"), so
deposit_refunded_if_swap_expiresnow lets the offer land before jumping.join_private_group_with_invitation_succeedsandcall_push_tests::invariant_1_only_small_private_groups_ringalso got more ticks. Both already flake on master for the same reason, which PocketIC 16 made worse.3. Pay-as-you-go HTTPS outcall pricing is behind a flag
pricing_version: 2is honoured only where the replica'sflexible_http_requestsflag is on. It was switched on in dfinity/ic#11399 (2026-09-02). I checked all 42 mainnet subnets: every one runs a replica built after that commit, with the flag enabled. PocketIC 16 predates the switch, so it enables the flag only with beta features, and beta features consist of just that flag. Fix: envs now enable beta features, matching mainnet. This is needed to test pay-as-you-go outcalls, such as the OpenAI moderation migration that follows #9618.Other
SettingTimeIntoPast, so the test uses a fresh env.fire_and_forget_handler_tests,send_direct_message_tests) now wait out a cross-subnet round trip before restarting the canister. Otherwise the first attempt lands after the restart and nothing fails.daily_puzzle_start_submit_and_streaknow discards its env. It pushes a made-uplight_uppuzzle for the current day into the LocalUserIndex, which shadowed the real puzzle indaily_puzzle_end_to_endwhenever that test drew the same env on a day whose real puzzle is alsolight_up. That now happens reliably, because pooled envs reach 2026-11-01.local_canister_creatorreads the default effective canister id from the topology JSON itself. pocket-ic 16'sTopologyrequires fields, such ascost_schedule, that the PocketIC server bundled with dfx doesn't return, sodeploy-local.shwould otherwise panic.thiserror = "=2.0.18", so the lockfile moves thiserror down one patch version from 2.0.19.Test plan
./scripts/run-integration-tests.sh build 8passes on PocketIC 16.0.0🤖 Generated with Claude Code