mirror of
https://github.com/lordmathis/llamactl.git
synced 2025-11-05 16:44:22 +00:00
Fix instance start simulation in TestUpdateInstance
This commit is contained in:
@@ -191,8 +191,10 @@ func TestUpdateInstance(t *testing.T) {
|
|||||||
t.Fatalf("CreateInstance failed: %v", err)
|
t.Fatalf("CreateInstance failed: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Simulate starting the instance
|
// Start the instance (will use 'yes' command from test config)
|
||||||
inst.SetStatus(instance.Running)
|
if err := inst.Start(); err != nil {
|
||||||
|
t.Fatalf("Failed to start instance: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
// Update running instance with new model
|
// Update running instance with new model
|
||||||
newOptions := &instance.Options{
|
newOptions := &instance.Options{
|
||||||
@@ -210,10 +212,9 @@ func TestUpdateInstance(t *testing.T) {
|
|||||||
t.Fatalf("UpdateInstance failed: %v", err)
|
t.Fatalf("UpdateInstance failed: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Should be either running or restarting after update
|
// Should be running after update (was running before, should be restarted)
|
||||||
status := updated.GetStatus()
|
if !updated.IsRunning() {
|
||||||
if status != instance.Running && status != instance.Restarting {
|
t.Errorf("Instance should be running after update, got: %v", updated.GetStatus())
|
||||||
t.Error("Instance should be running or restarting after update")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if updated.GetOptions().BackendOptions.LlamaServerOptions.Model != "/path/to/new-model.gguf" {
|
if updated.GetOptions().BackendOptions.LlamaServerOptions.Model != "/path/to/new-model.gguf" {
|
||||||
|
|||||||
Reference in New Issue
Block a user