Publish curated Unraid-AppOps-Gateway source from df9538cc820b70cece4f17eb9034739917560f96
This commit is contained in:
1 parent
84a7616341
commit
f37a7b8b42
5 files changed
+579
-6
No files matched your search
@@ -277,6 +277,32 @@ def test_handover_cli_redacts_errors_and_does_not_misreport_unknown_writes(contr
|
||||
assert result["status"] == "blocked" and result["executed"] is False
|
||||
|
||||
|
||||
@pytest.mark.parametrize("profile,claims,required_mib", [
|
||||
("build", ["build"], 15 * 1024),
|
||||
("build", ["build", "checks"], 15 * 1024 + 1536),
|
||||
("browser", ["browser"], 20 * 1024),
|
||||
("backend", ["backend"], 15 * 1024),
|
||||
])
|
||||
def test_profile_memory_boundary_keeps_other_claims_and_stability(
|
||||
controller_module, monkeypatch, profile, claims, required_mib
|
||||
):
|
||||
controller, now, host, _ = _host_gate_sample(controller_module, monkeypatch)
|
||||
required_bytes = required_mib * 1024**2
|
||||
host["availableMemoryBytes"] = required_bytes - 1
|
||||
state = {}
|
||||
assert controller._fresh_mutation_gate(profile, claims, state)[0] == "runner_admission_host_headroom_insufficient"
|
||||
assert state["hostStability"] is None
|
||||
|
||||
host["availableMemoryBytes"] = required_bytes
|
||||
assert controller._fresh_mutation_gate(profile, claims, state)[0] == "runner_admission_host_headroom_not_stable"
|
||||
now[0] = 159
|
||||
host["swapSampleAt"] = 159
|
||||
assert controller._fresh_mutation_gate(profile, claims, state)[0] == "runner_admission_host_headroom_not_stable"
|
||||
now[0] = 160
|
||||
host["swapSampleAt"] = 160
|
||||
assert controller._fresh_mutation_gate(profile, claims, state)[0] is None
|
||||
|
||||
|
||||
def test_safe_live_metric_fluctuations_do_not_restart_stable_headroom(controller_module, monkeypatch):
|
||||
module = controller_module
|
||||
controller, now, host, _ = _host_gate_sample(module, monkeypatch)
|
||||
|
||||
Reference in new issue
Block a user