mirror of
https://github.com/rclone/rclone.git
synced 2026-10-01 10:15:37 -04:00
bisync: fix flaky TestBisyncConcurrent by increasing random name entropy
The temp directory name used random.String(2) giving only 676 possible values. When multiple concurrent tests started in the same second, they shared the same timestamp prefix, causing name collisions and shared temp directories. This led to lock file conflicts, listing file races, and file deletion errors. Increase to random.String(8) to make collisions effectively impossible.
This commit is contained in:
1 parent
dd5250ca55
commit
bf55d5e6d3
1 file changed
+1
-1
@@ -329,7 +329,7 @@ func testBisync(ctx context.Context, t *testing.T, path1, path2 string) {
|
||||
|
||||
baseDir, err := os.Getwd()
|
||||
require.NoError(t, err, "get current directory")
|
||||
randName := time.Now().Format("150405") + random.String(2) // some bucket backends don't like dots, keep this short to avoid linux errors
|
||||
randName := time.Now().Format("150405") + random.String(8) // some bucket backends don't like dots, keep this short to avoid linux errors
|
||||
tempDir := filepath.Join(os.TempDir(), randName)
|
||||
workDir := filepath.Join(tempDir, "workdir")
|
||||
|
||||
|
||||
Reference in new issue
Block a user