You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by jr...@apache.org on 2022/06/27 18:31:12 UTC
[beam] branch master updated: Add randomness to integration test job names to avoid collisions (#22065)
This is an automated email from the ASF dual-hosted git repository.
jrmccluskey pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git
The following commit(s) were added to refs/heads/master by this push:
new 71f9dd609c6 Add randomness to integration test job names to avoid collisions (#22065)
71f9dd609c6 is described below
commit 71f9dd609c61d77272852137426a7f5c896b2c85
Author: Danny McCormick <da...@google.com>
AuthorDate: Mon Jun 27 14:30:58 2022 -0400
Add randomness to integration test job names to avoid collisions (#22065)
* Add randomness to integration test job names to avoid collisions
* Correct seeds and imports
* fmt
* Update sdks/go/test/integration/integration.go
Co-authored-by: Jack McCluskey <34...@users.noreply.github.com>
Co-authored-by: Jack McCluskey <34...@users.noreply.github.com>
---
sdks/go/test/integration/integration.go | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/sdks/go/test/integration/integration.go b/sdks/go/test/integration/integration.go
index 7a397215c24..6ae13d0d9b5 100644
--- a/sdks/go/test/integration/integration.go
+++ b/sdks/go/test/integration/integration.go
@@ -36,9 +36,11 @@ package integration
import (
"fmt"
+ "math/rand"
"regexp"
"strings"
"testing"
+ "time"
// common runner flag.
"github.com/apache/beam/sdks/v2/go/pkg/beam/options/jobopts"
@@ -213,8 +215,9 @@ func CheckFilters(t *testing.T) {
t.Skipf("Test %v is currently sickbayed on all runners", n)
}
}
- // TODO(lostluck): Improve default job names.
- *jobopts.JobName = fmt.Sprintf("go-%v", strings.ToLower(n))
+ s1 := rand.NewSource(time.Now().UnixNano())
+ r1 := rand.New(s1)
+ *jobopts.JobName = fmt.Sprintf("go-%v-%v", strings.ToLower(n), r1.Intn(1000))
// Test for runner-specific skipping second.
var filters []string