1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// Project: scalo
// File: tests/operational_memory.rs
// Purpose: Black-box, cgroup-confined memory backpressure operational test
// Language: Rust
//
// License: Apache-2.0
// Copyright: (c) 2026 HYPERI PTY LIMITED
//! Operational memory test (CRITICAL, see the plan's "Operational testing"
//! section). This is NOT a code-block test -- it drives the real harness
//! ([`examples/mem_loadgen.rs`]) under a genuine cgroup `--memory` limit via
//! docker and asserts the KERNEL outcome with a with/without control:
//!
//! - cap=on -> survives and backpressures (rejected > 0)
//! - cap=off -> OOM-killed (the control proving the limit is real)
//!
//! `#[ignore]` by default: it needs docker and builds an image (~minutes), so
//! it runs in a dedicated/nightly CI job, not the per-push gate. Run with:
//!
//! ```sh
//! cargo nextest run --features memory --run-ignored all -E 'test(operational)'
//! # or directly:
//! scripts/operational-mem-test.sh 512m 15
//! ```
use Command;