test(sftp): wait for all transfers to finish

This commit is contained in:
Kaede Akino committed 2026-10-16 08:36:54 +08:00
1 parent 59bcfd92ee
commit 5e19dcc219
1 file changed
+2 -1
+2 -1
View File
@@ -632,7 +632,8 @@ struct SFTPFeatureTests {
#expect(await gate.maximumActive(for: "host-0") == limits.1)
for _ in 0..<500 {
await gate.releaseAll()
if coordinator.activeCount == 0 { break }
// Admission can still be pending between the last active task and its successor.
if coordinator.sftpTransfers.allSatisfy({ $0.state.isFinished }) { break }
try await Task.sleep(for: .milliseconds(10))
}
#expect(coordinator.sftpTransfers.allSatisfy { $0.state == .completed })