rclone/cmd/mountlib/mounttest
Nick Craig-Wood a4bc4daf30 mounttest: fix unreliable tests on Windows CI
The failure is this which is not reproducable locally, only on the CI
servers.

    --- FAIL: TestMount/CacheMode=minimal/TestWriteFileOverwrite (1.01s)
        fs.go:351:
            Error Trace:    fs.go:351
                            write.go:65
            Error:          Received unexpected error:
                            open E:testwrite: The request could not be performed because of an I/O device error.
            Test:           TestMount/CacheMode=minimal/TestWriteFileOverwrite

The corresponding ERROR from the log is this:

    ERROR : IO error: truncate C:\Users\runneradmin\AppData\Local\rclone\vfs\local\C\Users\RUNNER~1\AppData\Local\Temp\rclone298719627\testwrite: Access is denied.

Instead of using ioutil.WriteFile this fix uses an equivalent based on
rclone's lib/file which doesn't set the exclusive flag on
Windows. This allows files to be deleted that are open.  It also
deletes existing files if an error is received and retries.
2020-01-09 11:11:49 +00:00
..
dir.go build: fix up package paths after repo move 2019-07-28 18:47:38 +01:00
edge_cases.go mounttest: fix occasionally failing test TestRenameOpenHandle 2019-11-11 16:20:27 +00:00
file.go mount: replace use of WriteAt with Write for cache mode >= writes and O_APPEND 2019-10-26 17:27:52 +01:00
fs.go mounttest: fix unreliable tests on Windows CI 2020-01-09 11:11:49 +00:00
read_non_unix.go mountlib: fix cross platform tests 2017-05-15 16:56:46 +01:00
read_unix.go mountlib: fix cross platform tests 2017-05-15 16:56:46 +01:00
read.go Use io.SeekStart/End/Current constants now for go1.7+ #2154 2018-04-07 11:42:36 +01:00
write_non_unix.go vfs: move writeback of dirty data out of close() method into its own method (FlushWrites) and remove close() call from Flush() 2019-10-09 10:07:29 +01:00
write_unix.go vfs: move writeback of dirty data out of close() method into its own method (FlushWrites) and remove close() call from Flush() 2019-10-09 10:07:29 +01:00
write.go mount: replace use of WriteAt with Write for cache mode >= writes and O_APPEND 2019-10-26 17:27:52 +01:00