Closed EdgarDing77 closed 1 year ago
test case base_test.go TestFileNotFound will be hang, test failed, it is bug?
yes,The Ack does return err, but the errChan does not return normally
I also found that files downloaded from a remote location will not exit with an error if the permission is not given locally
I also found that files downloaded from a remote location will not exit with an error if the permission is not given locally
yes, if use os.OpenFile("./tmp/output_fnf.txt", os.O_CREATE|os.O_WRONLY, 0644)
will not exit but os.Open
can do it
I want to change it sometime
Thanks for opening this issue. Try to keep the discussion focussed on the original issue. I will try to confirm the failing test and keep you updated.
All tests succeed on my system (MacOS). Running ./run_all.sh
in the tests directory I get:
Running from /Users/bram/sources/go-scp/tests
Starting docker containers
1af8e08b9cab1083c86b64c8a77d173e8d59eafc93446b1452dfad1660936932
Running tests
=== RUN TestCopy
--- PASS: TestCopy (0.13s)
=== RUN TestDownloadFile
--- PASS: TestDownloadFile (0.10s)
=== RUN TestTimeoutDownload
--- PASS: TestTimeoutDownload (0.09s)
=== RUN TestContextCancelDownload
--- PASS: TestContextCancelDownload (0.09s)
=== RUN TestDownloadBadLocalFilePermissions
--- PASS: TestDownloadBadLocalFilePermissions (0.09s)
=== RUN TestFileNotFound
--- PASS: TestFileNotFound (0.08s)
PASS
ok github.com/bramvdbogaerde/go-scp/tests 0.702s
Tearing down docker containers
go-scp-test
go-scp-test
Cleaning up
@EdgarDing77 could you provide your full test output?
if i try to copy testfile and run it, will failed, it will hang long time. In practical use, this is also the case。
TEST NEV:
DEV ENV:
=== RUN TestDownloadFile
basicscp_test.go:89: Couldn't open the output file
but if i fork this repo and run basic_test.go, it will ok, So strange.
=== RUN TestDownloadFile
basic_test.go:97: Copy failed from remote: scp: /input/Exöt1ç download file.txt.txt: No such file or directory
basic_test.go:108: Got different text than expected, expected "It works for download!\n" got, ""
--- FAIL: TestDownloadFile (0.38s)
I think I got it. Branch master is different from release v1.2.0 —— github.com/bramvdbogaerde/go-scp v1.2.0 You can check your source code between in release and master.
@bramvdbogaerde
Can you release a new version to fix this? @bramvdbogaerde
New version has been released under the tag v1.2.1.
if remote file not found, use
CopyFromRemote
will not throw file not found on remote, it will keep connection util timeout.