mirror of
https://github.com/rclone/rclone.git
synced 2025-12-15 15:53:41 +00:00
tests: make test servers choose a random port to make more reliable
Tests have been randomly failing with messages like
listen tcp 127.0.0.1:51778: bind: address already in use
Rework all the test servers so they choose a random free port on
startup and use that for the tests to avoid.
This commit is contained in:
@@ -20,8 +20,7 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
testBindAddress = "localhost:51778"
|
||||
testURL = "http://" + testBindAddress + "/"
|
||||
testBindAddress = "localhost:0"
|
||||
)
|
||||
|
||||
// check interfaces
|
||||
@@ -70,7 +69,7 @@ func TestWebDav(t *testing.T) {
|
||||
cmd := exec.Command("go", args...)
|
||||
cmd.Env = append(os.Environ(),
|
||||
"RCLONE_CONFIG_WEBDAVTEST_TYPE=webdav",
|
||||
"RCLONE_CONFIG_WEBDAVTEST_URL="+testURL,
|
||||
"RCLONE_CONFIG_WEBDAVTEST_URL="+w.Server.URL(),
|
||||
"RCLONE_CONFIG_WEBDAVTEST_VENDOR=other",
|
||||
)
|
||||
out, err := cmd.CombinedOutput()
|
||||
|
||||
Reference in New Issue
Block a user