robustness: not overwrite results dir by giving each dir a unique name.

Signed-off-by: Siyuan Zhang <sizhang@google.com>
This commit is contained in:
Siyuan Zhang 2024-04-19 09:35:26 -07:00
parent e246bb8d4d
commit 3c3b76cea1

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)
}