From 4db281793256d43db6416eab23def531529a3598 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Wed, 28 Oct 2026 12:59:21 +0000 Subject: [PATCH] fstest: shut down test remotes when finished with them Remotes made by RandomRemote aren't in the fs cache so they were never shut down, leaving any pooled connections open until they timed out. On TestFTPProftpd this used up the server's 30 connection limit part way through the fs/operations tests, making all the following tests fail with EOF when connecting. --- fstest/fstest.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/fstest/fstest.go b/fstest/fstest.go index 2267b0b43..ebad580a7 100644 --- a/fstest/fstest.go +++ b/fstest/fstest.go @@ -476,6 +476,14 @@ func RandomRemote() (fs.Fs, string, func(), error) { fs.Logf(nil, "Failed to purge %v: %v", parentRemote, err) } } + // The remote isn't in the fs cache so release its resources + // (e.g. pooled connections) here rather than letting them + // pile up until they time out. + if do := remote.Features().Shutdown; do != nil { + if err := do(context.Background()); err != nil { + fs.Logf(nil, "Failed to shutdown %v: %v", remote, err) + } + } } return remote, remoteName, finalise, nil