fix: finish cross-platform test parity while keeping POSIX deployment semantics

- cutover readState: enforce 0600 mode bits only on POSIX (Windows ACLs
  govern access; chmod is a no-op there)
- backup activation: skip the read-only-handle fsync on win32; the staged
  rename-over-open-WAL tests keep running on the POSIX deployment targets
- test-fixtures: normalize fixture paths to POSIX separators before
  comparing with manifest entries
This commit is contained in:
chick
2026-09-07 01:18:44 +08:00
parent 96dd9e2ba6
commit c57dc81e42
7 changed files with 32 additions and 19 deletions
+2 -1
View File
@@ -314,7 +314,8 @@ function preparedState(plan: CutoverPlan): CutoverState {
async function readState(plan: CutoverPlan): Promise<CutoverState> {
const path = join(plan.stateDir, STATE_FILE);
const info = await lstat(path);
if (!info.isFile() || (info.mode & 0o777) !== 0o600)
// Windows keeps no POSIX mode bits (chmod is a no-op); ACLs govern access there.
if (!info.isFile() || (process.platform !== 'win32' && (info.mode & 0o777) !== 0o600))
throw new Error('Cutover state must be a mode-0600 regular file');
const input = record(JSON.parse(await readFile(path, 'utf8')) as unknown, 'Cutover state');
const base = ['version', 'phase', 'legacyPid', 'legacyCommand', 'legacyIdentity', 'legacyStart'];