Drive the archive reopen debounce test from a clock (closes #190)
check / check (push) Waiting to run

The archive writer now reads the time its reopen debounce is
measured on from a clock field, time.Now outside tests. The
debounce test moves that clock instead of sleeping past a real
2 second window, so a slow host between the two quick writes can
no longer turn a correct result red.

Model: opus-5-5
This commit is contained in:
2026-10-02 12:18:54 +00:00
parent 8cf5acaf1d
commit d17a687dba
3 changed files with 24 additions and 6 deletions
+6
View File
@@ -512,6 +512,12 @@ func (e *ExportArchiveWriter) Reopen(
return e.w.reopen(expiry)
}
// SetNow replaces the clock the writer measures its reopen
// debounce on.
func (e *ExportArchiveWriter) SetNow(now func() time.Time) {
e.w.now = now
}
// Reopens reports how many times the file has been opened.
func (e *ExportArchiveWriter) Reopens() int {
return e.w.reopens