Skip to content

Commit 958534b

Browse files
authored
fix(ci): restore cross-platform main checks (#1313)
Main is red for two independent assumptions exposed by loaded runners. On Windows, Go can resolve a saved FileInfo identity lazily from its pathname, allowing an old activity-hint cursor snapshot to bind to an atomic replacement and skip replay. Capturing identity with the cursor keeps replacements distinguishable across platforms. Coverage instrumentation can also push the artifact package beyond Go's default ten-minute timeout while the package is still making progress and completes within the ordinary suite's existing budget. Aligning coverage with that twenty-minute allowance prevents false aborts without weakening assertions. Co-authored-by: Wes McKinney <wesm@users.noreply.github.com>
1 parent d00ae43 commit 958534b

2 files changed

Lines changed: 18 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ jobs:
232232
run: go run ./internal/pricing/cmd/litellm-snapshot -restore
233233

234234
- name: Test with coverage
235-
run: go test -tags "fts5" -coverprofile=coverage.out ./...
235+
run: go test -tags "fts5" -coverprofile=coverage.out ./... -timeout=20m
236236
env:
237237
CGO_ENABLED: "1"
238238

internal/sync/activity_hint_reader.go

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ const (
2424

2525
type activityHintCursor struct {
2626
info os.FileInfo
27+
inode int64
28+
device int64
29+
hasIdentity bool
2730
offset int64
2831
boundaryDigest [sha256.Size]byte
2932
boundaryLength int
@@ -71,9 +74,19 @@ func readActivityHints(
7174
)
7275
}
7376

77+
// Freeze identity now. Windows FileInfo resolves SameFile lazily from the
78+
// path, so an old snapshot can otherwise resolve to its replacement.
79+
inode, device := getFileIdentity(source.Path, info)
80+
hasIdentity := inode != 0 || device != 0
81+
sameFile := false
82+
if cursor.hasIdentity && hasIdentity {
83+
sameFile = cursor.inode == inode && cursor.device == device
84+
} else if cursor.info != nil {
85+
sameFile = os.SameFile(cursor.info, info)
86+
}
7487
if cursor.initialized &&
7588
(cursor.info == nil ||
76-
!os.SameFile(cursor.info, info) ||
89+
!sameFile ||
7790
info.Size() < cursor.offset) {
7891
*cursor = activityHintCursor{}
7992
}
@@ -138,6 +151,9 @@ func readActivityHints(
138151

139152
result.BytesRead = len(data)
140153
cursor.info = info
154+
cursor.inode = inode
155+
cursor.device = device
156+
cursor.hasIdentity = hasIdentity
141157
cursor.offset = start + int64(len(data))
142158
cursor.initialized = true
143159
digest, length, err := readActivityHintBoundary(file, cursor.offset)

0 commit comments

Comments
 (0)