From e5e6a4b5aebba4e33e86ee3506174997c12d1bad Mon Sep 17 00:00:00 2001 From: dougal <147946567+roucc@users.noreply.github.com> Date: Wed, 10 Dec 2025 15:43:22 +0000 Subject: [PATCH] sync: fix error propagation in tests (#9025) This commit fixes the sync transform test IO errors by resetting the error flag which stops subsequent tests failing. --- fs/sync/sync_test.go | 1 + fs/sync/sync_transform_test.go | 2 ++ 2 files changed, 3 insertions(+) diff --git a/fs/sync/sync_test.go b/fs/sync/sync_test.go index 6fe57d824..69eac3811 100644 --- a/fs/sync/sync_test.go +++ b/fs/sync/sync_test.go @@ -1301,6 +1301,7 @@ func TestSyncAfterRemovingAFileAndAddingAFileSubDirWithErrors(t *testing.T) { err := Sync(ctx, r.Fremote, r.Flocal, false) assert.Equal(t, fs.ErrorNotDeleting, err) testLoggerVsLsf(ctx, r.Fremote, r.Flocal, operations.GetLoggerOpt(ctx).JSON, t) + accounting.GlobalStats().ResetCounters() r.CheckLocalListing( t, diff --git a/fs/sync/sync_transform_test.go b/fs/sync/sync_transform_test.go index d43594509..930386a85 100644 --- a/fs/sync/sync_transform_test.go +++ b/fs/sync/sync_transform_test.go @@ -13,6 +13,7 @@ import ( _ "github.com/rclone/rclone/backend/all" "github.com/rclone/rclone/fs" + "github.com/rclone/rclone/fs/accounting" "github.com/rclone/rclone/fs/filter" "github.com/rclone/rclone/fs/operations" "github.com/rclone/rclone/fs/walk" @@ -507,6 +508,7 @@ func TestError(t *testing.T) { err = Sync(ctx, r.Fremote, r.Flocal, true) // testLoggerVsLsf(ctx, r.Fremote, r.Flocal, operations.GetLoggerOpt(ctx).JSON, t) assert.Error(t, err) + accounting.GlobalStats().ResetCounters() r.CheckLocalListing(t, []fstest.Item{file1}, []string{"toe", "toe/toe"}) r.CheckRemoteListing(t, []fstest.Item{file1}, []string{"toe", "toe/toe"})