From c0706452a98768a62bb8d4e504256beec0674832 Mon Sep 17 00:00:00 2001 From: luc-blaeser Date: Wed, 15 Jan 2025 10:12:06 +0100 Subject: [PATCH] Adjust test and refine documentation --- doc/md/canister-maintenance/memory.md | 4 ++-- test/bench/ok/region-mem.drun-run.ok | 2 +- test/bench/ok/region0-mem.drun-run.ok | 2 +- test/bench/ok/stable-mem.drun-run.ok | 2 +- test/fail/ok/M0129.tc.ok | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/md/canister-maintenance/memory.md b/doc/md/canister-maintenance/memory.md index 053efab8f3f..383f77e6d2e 100644 --- a/doc/md/canister-maintenance/memory.md +++ b/doc/md/canister-maintenance/memory.md @@ -19,8 +19,8 @@ actor { } ``` -A few aspects need to be considered with the low memory hook: -* The execution of `onLowMemory` happens with a certain delay, as it is scheduled as separate asynchronous message that runs after the message in which the threshold was crossed. +The following properties apply to the low memory hook: +* The execution of `onLowMemory` happens with a certain delay, as it is scheduled as a separate asynchronous message that runs after the message in which the threshold was crossed. * Once executed, `onLowMemory` is only triggered again when the main memory free space went above the threshold (e.g. by lowering the threshold or shrinking the main memory through canister reinstallation) and when the free space again fell below the threshold. * Traps or unhandled errors in `onLowMemory` are ignored. They only revert the changes done in `onLowMemory`. * Due to its `async` return type, the `onLowMemory` function may send further messages and await results. diff --git a/test/bench/ok/region-mem.drun-run.ok b/test/bench/ok/region-mem.drun-run.ok index 28c1137fc32..3cd8271667f 100644 --- a/test/bench/ok/region-mem.drun-run.ok +++ b/test/bench/ok/region-mem.drun-run.ok @@ -1,4 +1,4 @@ ingress Completed: Reply: 0x4449444c016c01b3c4b1f204680100010a00000000000000000101 ingress Completed: Reply: 0x4449444c0000 -debug.print: {heap_diff = 0; instr_diff = 5_234_491_753} +debug.print: {heap_diff = 0; instr_diff = 5_240_635_753} ingress Completed: Reply: 0x4449444c0000 diff --git a/test/bench/ok/region0-mem.drun-run.ok b/test/bench/ok/region0-mem.drun-run.ok index 1d45643d325..1b1eccc80c7 100644 --- a/test/bench/ok/region0-mem.drun-run.ok +++ b/test/bench/ok/region0-mem.drun-run.ok @@ -1,4 +1,4 @@ ingress Completed: Reply: 0x4449444c016c01b3c4b1f204680100010a00000000000000000101 ingress Completed: Reply: 0x4449444c0000 -debug.print: {heap_diff = 0; instr_diff = 5_662_310_761} +debug.print: {heap_diff = 0; instr_diff = 5_668_454_761} ingress Completed: Reply: 0x4449444c0000 diff --git a/test/bench/ok/stable-mem.drun-run.ok b/test/bench/ok/stable-mem.drun-run.ok index 5e3eeec3bce..13861dd869a 100644 --- a/test/bench/ok/stable-mem.drun-run.ok +++ b/test/bench/ok/stable-mem.drun-run.ok @@ -1,4 +1,4 @@ ingress Completed: Reply: 0x4449444c016c01b3c4b1f204680100010a00000000000000000101 ingress Completed: Reply: 0x4449444c0000 -debug.print: {heap_diff = 0; instr_diff = 3_875_537_257} +debug.print: {heap_diff = 0; instr_diff = 3_881_681_257} ingress Completed: Reply: 0x4449444c0000 diff --git a/test/fail/ok/M0129.tc.ok b/test/fail/ok/M0129.tc.ok index 14f666c0262..5cfe1d802a1 100644 --- a/test/fail/ok/M0129.tc.ok +++ b/test/fail/ok/M0129.tc.ok @@ -1 +1 @@ -M0129.mo:2.15-2.21: type error [M0129], unexpected system method named foobar, expected heartbeat or timer or preupgrade or postupgrade or inspect +M0129.mo:2.15-2.21: type error [M0129], unexpected system method named foobar, expected heartbeat or timer or preupgrade or postupgrade or onLowMemory or inspect