Merge pull request #17827 from siyuanfoundation/flaky

robustness: Add option to not overwrite results dir.
This commit is contained in:
Marek Siarkowicz 2024-04-24 22:48:02 +02:00 committed by GitHub
commit 9027014adb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -20,6 +20,7 @@ import (
"path/filepath"
"strings"
"testing"
"time"
"go.uber.org/zap"
@ -42,7 +43,8 @@ func testResultsDirectory(t *testing.T) string {
if err != nil {
panic(err)
}
path, err := filepath.Abs(filepath.Join(resultsDirectory, strings.ReplaceAll(t.Name(), "/", "_")))
path, err := filepath.Abs(filepath.Join(
resultsDirectory, strings.ReplaceAll(t.Name(), "/", "_"), fmt.Sprintf("%v", time.Now().UnixNano())))
if err != nil {
t.Fatal(err)
}