diff --git a/fstest/fstest.go b/fstest/fstest.go index 794362b64..e2a594011 100644 --- a/fstest/fstest.go +++ b/fstest/fstest.go @@ -482,7 +482,9 @@ func RandomRemote() (fs.Fs, string, func(), error) { // // It logs errors rather than returning them func Purge(f fs.Fs) { - ctx := context.Background() + // Create a stats group here so errors in the cleanup don't + // interfere with the global stats. + ctx := accounting.WithStatsGroup(context.Background(), "test-cleanup") var err error doFallbackPurge := true if doPurge := f.Features().Purge; doPurge != nil {