From be73a10a97ba75cfd66fc7bf0b8a09fe73d69d7c Mon Sep 17 00:00:00 2001 From: nielash Date: Sun, 10 Aug 2025 17:57:21 -0400 Subject: [PATCH] googlecloudstorage: fix rateLimitExceeded error on bisync tests Additional to googlecloudstorage's general rate limiting, it apparently has a separate limit for updating the same object more than once per second: googleapi: Error 429: The object rclone-test- demilaf1fexu/015108so/check_access/path2/modtime_write_test exceeded the rate limit for object mutation operations (create, update, and delete). Please reduce your request rate. See https://cloud.google.com/storage/docs/gcs429., rateLimitExceeded We were encountering this in the part of the bisync tests where we create an object, verify that we can edit its modtime, then remove it. We were not encountering it elsewhere because it only concerns manipulations of the same object -- not the rate of API calls in general. For the same reason, the standard pacer is not an effective solution for enforcing this (unless, of course, we want to slow the entire test down by setting a 1s MinSleep across the board.) While ideally this would be handled in the backend, this gets around it by sleeping for 1s in the relevant part of the bisync tests. --- cmd/bisync/bisync_test.go | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/cmd/bisync/bisync_test.go b/cmd/bisync/bisync_test.go index 0bb5e47b3..2cee02f28 100644 --- a/cmd/bisync/bisync_test.go +++ b/cmd/bisync/bisync_test.go @@ -981,17 +981,23 @@ func (b *bisyncTest) checkPreReqs(ctx context.Context, opt *bisync.Options) (con objinfo := object.NewStaticObjectInfo("modtime_write_test", initDate, int64(len("modtime_write_test")), true, nil, nil) obj, err := f.Put(ctx, in, objinfo) require.NoError(b.t, err) + if !f.Features().IsLocal { + time.Sleep(time.Second) // avoid GoogleCloudStorage Error 429 rateLimitExceeded + } err = obj.SetModTime(ctx, initDate) if err == fs.ErrorCantSetModTime { - if b.testCase != "nomodtime" { - b.t.Skip("skipping test as at least one remote does not support setting modtime") - } + b.t.Skip("skipping test as at least one remote does not support setting modtime") + } + if !f.Features().IsLocal { + time.Sleep(time.Second) // avoid GoogleCloudStorage Error 429 rateLimitExceeded } err = obj.Remove(ctx) require.NoError(b.t, err) } - testSetModtime(b.fs1) - testSetModtime(b.fs2) + if b.testCase != "nomodtime" { + testSetModtime(b.fs1) + testSetModtime(b.fs2) + } if b.testCase == "normalization" || b.testCase == "extended_char_paths" || b.testCase == "extended_filenames" { // test whether remote is capable of running test