feat: Ollama-Adapter gegen echtes Ollama geprüft, Vulkan und Runner-Prozesse behandelt (M2.6a)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-09 18:25:14 +01:00
parent 216fb47686
commit a52fcff603
14 changed files with 154 additions and 36 deletions

View File

@ -113,6 +113,9 @@ async fn managed_start_endpoint_messung_und_stopp() {
);
assert!(log.contains("CUDA_VISIBLE_DEVICES=0,1"), "{log}");
assert!(log.contains("OLLAMA_MODELS="), "{log}");
assert!(log.contains("OLLAMA_VULKAN=0"), "{log}");
assert!(log.contains("OLLAMA_NO_CLOUD=1"), "{log}");
assert!(log.contains("OLLAMA_DEBUG_LOG_REQUESTS=false"), "{log}");
let usage = engine.measure(&inst).await;
assert_eq!(usage.vram_mb, Some(500_000_000 / (1024 * 1024)));
@ -127,6 +130,33 @@ async fn managed_start_endpoint_messung_und_stopp() {
engine.stop(&inst, Duration::from_secs(1)).await.unwrap();
}
fn runner_pids(log: &str) -> Vec<u32> {
log.lines()
.filter_map(|l| l.strip_prefix("fake-ollama: runner "))
.filter_map(|p| p.trim().parse().ok())
.collect()
}
#[tokio::test]
async fn nach_dem_stoppen_bleiben_keine_runner_prozesse_zurueck() {
let f = fixture("ok", 20);
let engine = OllamaEngine::new(f.config.clone());
let a = engine.start(&profile("a", "qwen3:0.6b")).await.unwrap();
let b = engine.start(&profile("b", "llama3")).await.unwrap();
let runners = runner_pids(&server_log(&f));
assert_eq!(runners.len(), 2, "je Modell ein Runner: {runners:?}");
assert!(runners.iter().all(|p| process_exists(*p)));
engine.stop(&a, Duration::from_secs(5)).await.unwrap();
engine.stop(&b, Duration::from_secs(5)).await.unwrap();
for pid in runners {
assert!(
wait_until_gone(pid).await,
"Runner {pid} lief nach dem Stoppen weiter"
);
}
}
#[tokio::test]
async fn zwei_modelle_teilen_sich_einen_server_der_mit_dem_letzten_endet() {
let f = fixture("ok", 20);