The ntfy tests write subscription state files about 5,000 times, and each
write flushed the temporary file and its directory to disk. On the CI
runner, where a flush costs tens of milliseconds, the package outran the
five-minute test timeout in TestSoak.
saveState and syncDir now flush through a syncFile variable, which the
package's TestMain replaces with a no-op. TestSaveStateSyncs puts the real
flush back and checks that the temporary file is flushed before the
rename, the directory after it, and that a failed flush leaves the old
state file and no temporary file. Production behaviour is unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>