1
0
mirror of https://github.com/rclone/rclone.git synced 2025-11-23 21:44:49 +02:00

fstest: stop errors in test cleanup changing the global stats

This was causing the concurrent bisync tests to fail every now and again.
This commit is contained in:
Nick Craig-Wood
2025-08-28 17:06:43 +01:00
parent b41f7994da
commit 04683f2032

View File

@@ -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 {