Toolchain Incompatability: `pocket-ic` with `ic-cdk >v0.12` on latest `dfx v0.27.0`

Is it just me or does pocket-ic not work with recent versions of dfx.

My Setup:

  • DFX: v0.27.0 (latest)
  • Canister CDK: ic-cdk v0.13.2
  • Testing Library: pocket-ic v2.2.0 (which is the version compatible with dfx v0.27.0)

The Problem:
pocket-ic v2.2.0 has a strict dependency on ic-cdk = "=0.12.0". This directly conflicts with using the newer features in ic-cdk v0.13+ in my main canisters.

Since I’m already on the latest dfx, upgrading it is not an option.

I recently upgraded from 0.18-0.27 because of a failure to set up pocket-ic (similar toolchain issues).

Attempted Workaround & Roadblock:
I could isolate the test crate and use a [patch] in a local .cargo/config.toml to override ic-cdk just for the tests, but for separate unknown reasons I could never get the tests to run.

So, my question is: How are others successfully testing modern canisters against the latest dfx version? Is there a more reliable way to override the test dependencies, or another strategy entirely?

P.S. I’ve always avoided pocket-ic but now I really need it. Since I never used it I might also be missing something minor/foolish here.

The fix was simple for anyone who runs into this. I basically wasn’t upgrading pocket-ic to the new standard version.

Solution: Install and unzip the pocket-ic bianary and follow the readme of this repo: GitHub - dfinity/pocketic: A canister smart contract testing solution for the Internet Computer.

Lesson: Make sure cargo [dependencies] read “>=” pocket-ic = “9.0.2” for ic-cdk >v12.