test(extensions): skip POSIX permission assertion on Windows

The signed-session test from #462 asserts the session file is 0600,
but Windows does not preserve Unix permission bits, so the suite failed
on Windows dev machines while passing in CI.
This commit is contained in:
zarzet
2026-07-10 10:24:25 +07:00
parent f808a6a369
commit b1f8224310
+6 -2
View File
@@ -10,6 +10,7 @@ import (
"io"
"net/http"
"os"
goruntime "runtime"
"strings"
"testing"
"time"
@@ -309,8 +310,11 @@ func TestLoadAndSaveSignedSessionRoundTrip(t *testing.T) {
if err != nil {
t.Fatalf("expected session file to be persisted: %v", err)
}
if perm := info.Mode().Perm(); perm != 0o600 {
t.Errorf("session file perm = %o, want 0600", perm)
// Windows does not preserve Unix permission bits, so only assert on POSIX.
if goruntime.GOOS != "windows" {
if perm := info.Mode().Perm(); perm != 0o600 {
t.Errorf("session file perm = %o, want 0600", perm)
}
}
record.SessionID = "sess-1"