Skip to content

Commit

Permalink
fix chunking instruction limit issue
Browse files Browse the repository at this point in the history
  • Loading branch information
lastmjs committed Dec 31, 2024
1 parent 452022a commit 631bba7
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 1 deletion.
Binary file modified canister_templates/experimental.wasm
Binary file not shown.
Binary file modified canister_templates/stable.wasm
Binary file not shown.
2 changes: 1 addition & 1 deletion examples/stable/test/property/ic_api/chunk/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ async function sum(loops: number, shouldChunk: boolean): Promise<void> {
for (let i = 0; i < loops; i++) {
_sum += (i % 100) * (i % 100);

if (shouldChunk && i % 15_000_000 === 0) {
if (shouldChunk && i % 14_000_000 === 0) {
await chunk();
}
}
Expand Down
3 changes: 3 additions & 0 deletions examples/stable/test/property/ic_api/chunk/test/tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ export function getTests(): Test {
);
});

// TODO this test will simply hang if it fails because timers don't throw any errors that we can catch
// TODO we would need to use the canister logs somehow to check if the timer has hit its instruction limit
// TODO but see this issue: https://forum.dfinity.org/t/no-instruction-limit-hit-canister-logs-within-timer/39518
it('should not hit the instruction limit with chunking in a timer', async () => {
const actor = await getCanisterActor<Actor>('canister');

Expand Down

0 comments on commit 631bba7

Please sign in to comment.