From 6ec2919049002470c84d9729e182afbba498c0d6 Mon Sep 17 00:00:00 2001 From: LordMathis Date: Mon, 27 Oct 2025 19:14:54 +0100 Subject: [PATCH] Fix instance start simulation in TestUpdateInstance --- pkg/manager/operations_test.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pkg/manager/operations_test.go b/pkg/manager/operations_test.go index a11526d..870e907 100644 --- a/pkg/manager/operations_test.go +++ b/pkg/manager/operations_test.go @@ -191,8 +191,10 @@ func TestUpdateInstance(t *testing.T) { t.Fatalf("CreateInstance failed: %v", err) } - // Simulate starting the instance - inst.SetStatus(instance.Running) + // Start the instance (will use 'yes' command from test config) + if err := inst.Start(); err != nil { + t.Fatalf("Failed to start instance: %v", err) + } // Update running instance with new model newOptions := &instance.Options{ @@ -210,10 +212,9 @@ func TestUpdateInstance(t *testing.T) { t.Fatalf("UpdateInstance failed: %v", err) } - // Should be either running or restarting after update - status := updated.GetStatus() - if status != instance.Running && status != instance.Restarting { - t.Error("Instance should be running or restarting after update") + // Should be running after update (was running before, should be restarted) + if !updated.IsRunning() { + t.Errorf("Instance should be running after update, got: %v", updated.GetStatus()) } if updated.GetOptions().BackendOptions.LlamaServerOptions.Model != "/path/to/new-model.gguf" {