test: fix flaky tests with nonexistent path assertions

Tests using /nonexistent/... paths fail in sandboxed environments
where they return 'permission denied' instead of 'not exists'.
Use /tmp/... paths instead which reliably return 'not exists'.
This commit is contained in:
rcourtman 2026-01-04 15:38:30 +00:00
parent 121adbf00a
commit f77025fb2f
3 changed files with 168 additions and 3 deletions

View file

@ -311,8 +311,8 @@ zero:300000:0
t.Fatalf("expected 2 ranges, got %d", len(ranges))
}
// Test missing file
ranges, err = loadSubIDRanges("/nonexistent/file", nil)
// Test missing file - use path under /tmp to reliably get "not exists" vs "permission denied"
ranges, err = loadSubIDRanges("/tmp/nonexistent_subid_test_file_xyz123", nil)
if err != nil {
t.Fatalf("expected no error for nonexistent file, got %v", err)
}