Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

serve sftp: fix race in the tests #4171

Nick Craig-Wood117ff1d78119
diff --git a/cmd/serve/servetest/servetest.go b/cmd/serve/servetest/servetest.go
index 1ef1497a9..40f23222b 100644
--- a/cmd/serve/servetest/servetest.go
+++ b/cmd/serve/servetest/servetest.go
@@ -29,8 +29,6 @@ type StartFn func(f fs.Fs) (configmap.Simple, func())
// run runs the server then runs the unit tests for the remote against
// it.
func run(t *testing.T, name string, start StartFn, useProxy bool) {
- fstest.Initialise()
-
fremote, _, clean, err := fstest.RandomRemote()
assert.NoError(t, err)
defer clean()
@@ -98,6 +96,7 @@ func run(t *testing.T, name string, start StartFn, useProxy bool) {
// Run runs the server then runs the unit tests for the remote against
// it.
func Run(t *testing.T, name string, start StartFn) {
+ fstest.Initialise()
t.Run("Normal", func(t *testing.T) {
run(t, name, start, false)
})