fix(ci): address Windows test failures and timeout
- Extract inode function to platform-specific files (inode_unix.go, inode_windows.go) to fix syscall.Stat_t compile error on Windows - Add skipOnWindows helper and skip Unix permission/symlink tests on Windows where chmod semantics differ - Increase Windows test timeout from 10m to 20m since full test suite runs slower without race detector Fixes Windows CI failures introduced when PR #904 expanded Windows testing from smoke tests to full test suite. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
committed by
Steve Yegge
parent
ffe0dca2a3
commit
2fb6fd074a
@@ -6,7 +6,6 @@ import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"sync"
|
||||
"syscall"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
@@ -15,20 +14,6 @@ import (
|
||||
_ "github.com/ncruces/go-sqlite3/embed"
|
||||
)
|
||||
|
||||
// getInode returns the inode of a file (Unix only)
|
||||
func getInode(path string) uint64 {
|
||||
info, err := os.Stat(path)
|
||||
if err != nil {
|
||||
return 0
|
||||
}
|
||||
if sys := info.Sys(); sys != nil {
|
||||
if stat, ok := sys.(*syscall.Stat_t); ok {
|
||||
return stat.Ino
|
||||
}
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// testFreshnessEnv creates two independent connections to the same database file.
|
||||
// conn1 simulates the daemon's long-lived connection.
|
||||
// conn2 simulates an external process (like git merge bringing in new data).
|
||||
|
||||
23
internal/storage/sqlite/inode_unix.go
Normal file
23
internal/storage/sqlite/inode_unix.go
Normal file
@@ -0,0 +1,23 @@
|
||||
//go:build !windows
|
||||
|
||||
package sqlite
|
||||
|
||||
import (
|
||||
"os"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
// getInode returns the inode of a file (Unix only).
|
||||
// Used for debugging file replacement detection in tests.
|
||||
func getInode(path string) uint64 {
|
||||
info, err := os.Stat(path)
|
||||
if err != nil {
|
||||
return 0
|
||||
}
|
||||
if sys := info.Sys(); sys != nil {
|
||||
if stat, ok := sys.(*syscall.Stat_t); ok {
|
||||
return stat.Ino
|
||||
}
|
||||
}
|
||||
return 0
|
||||
}
|
||||
9
internal/storage/sqlite/inode_windows.go
Normal file
9
internal/storage/sqlite/inode_windows.go
Normal file
@@ -0,0 +1,9 @@
|
||||
//go:build windows
|
||||
|
||||
package sqlite
|
||||
|
||||
// getInode returns 0 on Windows as inodes don't exist.
|
||||
// Used for debugging file replacement detection in tests.
|
||||
func getInode(_ string) uint64 {
|
||||
return 0
|
||||
}
|
||||
Reference in New Issue
Block a user