Browse Source

fix test cases on Windows

Nicola Murino 5 years ago
parent
commit
0c6e2b566b
1 changed files with 2 additions and 0 deletions
  1. 2 0
      sftpd/sftpd_test.go

+ 2 - 0
sftpd/sftpd_test.go

@@ -1701,6 +1701,7 @@ func TestBandwidthAndConnections(t *testing.T) {
 		}
 		err = <-c
 		assert.Error(t, err, "connection closed while uploading: the upload must fail")
+		waitForNoActiveTransfer()
 		err = os.Remove(testFilePath)
 		assert.NoError(t, err)
 		err = os.Remove(localDownloadPath)
@@ -4042,6 +4043,7 @@ func appendToTestFile(path string, size int64) error {
 	if err != nil {
 		return err
 	}
+	defer f.Close()
 	written, err := io.Copy(f, bytes.NewReader(content))
 	if err != nil {
 		return err