1a69fcfd04
- Updated the installation script to clarify that production wrappers do not include fixed test secrets, improving user guidance for local testing. - Modified the jiggablend-manager and jiggablend-runner scripts to remove fixed test configurations, emphasizing the use of local test credentials via `make init-test`. - Enhanced error handling in the runner script to ensure that an API key is provided, improving security and user feedback. - Added new flags and options for the runner, including sandboxing capabilities and GPU ray tracing control, enhancing flexibility for users. - Improved README documentation to reflect changes in usage and configuration, ensuring users have clear instructions for setup and execution.
58 lines
1.5 KiB
Go
58 lines
1.5 KiB
Go
package tasks
|
|
|
|
import "testing"
|
|
|
|
func TestCheckGPUErrorLine_TriggersCallback(t *testing.T) {
|
|
p := NewRenderProcessor()
|
|
triggered := 0
|
|
ctx := &Context{
|
|
OnGPUError: func() {
|
|
triggered++
|
|
// Simulate runner arming lockout for this attempt.
|
|
},
|
|
}
|
|
p.checkGPUErrorLine(ctx, "Fatal: Illegal address in HIP kernel execution")
|
|
if triggered != 1 {
|
|
t.Fatalf("expected GPU error callback once, got %d", triggered)
|
|
}
|
|
// After arming, further fault lines must not re-fire (spam protection).
|
|
ctx.GPULockoutArmedThisAttempt = true
|
|
p.checkGPUErrorLine(ctx, "page not present in GPU memory")
|
|
if triggered != 1 {
|
|
t.Fatalf("expected no further callbacks after arm, got %d", triggered)
|
|
}
|
|
}
|
|
|
|
func TestCheckGPUErrorLine_SkipsWhenAlreadyLockedOut(t *testing.T) {
|
|
p := NewRenderProcessor()
|
|
triggered := false
|
|
ctx := &Context{
|
|
GPULockedOut: true,
|
|
OnGPUError: func() { triggered = true },
|
|
}
|
|
p.checkGPUErrorLine(ctx, "Illegal address in HIP")
|
|
if triggered {
|
|
t.Fatal("did not expect callback when GPU already locked out")
|
|
}
|
|
}
|
|
|
|
func TestGetBlenderVersion_EmptyWhenMissing(t *testing.T) {
|
|
ctx := &Context{}
|
|
if got := ctx.GetBlenderVersion(); got != "" {
|
|
t.Fatalf("expected empty blender version, got %q", got)
|
|
}
|
|
}
|
|
|
|
func TestCheckGPUErrorLine_IgnoresNormalLine(t *testing.T) {
|
|
p := NewRenderProcessor()
|
|
triggered := false
|
|
ctx := &Context{
|
|
OnGPUError: func() { triggered = true },
|
|
}
|
|
p.checkGPUErrorLine(ctx, "Render completed successfully")
|
|
if triggered {
|
|
t.Fatal("did not expect GPU callback for normal line")
|
|
}
|
|
}
|
|
|