Skip to content

Conversation

@praveen-influx
Copy link

@praveen-influx praveen-influx commented Dec 22, 2025

closes: #1610

Integration test ran manually

  • Run test_cgroup_limits_with_memory_constraint with 512M bound - passes as the test expects memory to be reported as 512M
❯ systemd-run --user --scope -p MemoryMax=512M cargo test --test cgroup_integration -- --ignored --nocapture
Running as unit: run-p1081902-i5275437.scope; invocation ID: fa8f6fa08f334494bf03d2ef7ca23214
    Finished `test` profile [unoptimized + debuginfo] target(s) in 0.01s
     Running tests/cgroup_integration.rs (target/debug/deps/cgroup_integration-e2b02b9d93054168)

running 1 test
CGroup limits detected: CGroupLimits { total_memory: 536870912, free_memory: 525611008, free_swap: 4294963200, rss: 9125888 }
test test_cgroup_limits_with_memory_constraint ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

  • Run test_cgroup_limits_with_memory_constraint with 1024M bound - fails the test
❯ systemd-run --user --scope -p MemoryMax=1024M cargo test --test cgroup_integration -- --ignored --nocapture
Running as unit: run-p1081827-i5275362.scope; invocation ID: 79b08c4bbb3c44a888a7e3505ee9939a
    Finished `test` profile [unoptimized + debuginfo] target(s) in 0.01s
     Running tests/cgroup_integration.rs (target/debug/deps/cgroup_integration-e2b02b9d93054168)

running 1 test

thread 'test_cgroup_limits_with_memory_constraint' (1081844) panicked at tests/cgroup_integration.rs:17:9:
Expected 512MB limit, got 1073741824 bytes
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
test test_cgroup_limits_with_memory_constraint ... FAILED

failures:

failures:
    test_cgroup_limits_with_memory_constraint

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

error: test failed, to rerun pass `--test cgroup_integration`

@praveen-influx praveen-influx force-pushed the fix-cgroup-detection branch 3 times, most recently from 19d1c21 to 0796f42 Compare December 22, 2025 18:36
@praveen-influx praveen-influx marked this pull request as ready for review December 22, 2025 19:14
@praveen-influx
Copy link
Author

@GuillaumeGomez - any idea why this check is failing, https://github.com/GuillaumeGomez/sysinfo/actions/runs/20441080932/job/58734423014?pr=1612, it looks unrelated to my changes (seems like a windows error) but I wanted to check before I started debugging the failure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sysinfo crate doesn't see max memory when set through systemd-run

1 participant