Skip to content

Commit 68a2388

Browse files
committed
roachprod: fix service registry unit test name collision
We were previously generating cluster names with Uint32, which is not sufficient enough to prevent naming collisions after 1000 iterations. Instead, use a RandString of length 10. Fixes: #157884 Release note: none
1 parent 8ff4da1 commit 68a2388

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/roachprod/install/services_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ func (t *serviceRegistryTest) makeVM(clusterName string, i int) vm.VM {
138138
}
139139

140140
func (t *serviceRegistryTest) newCluster(nodeCount int) *SyncedCluster {
141-
clusterName := fmt.Sprintf("cluster-%d", t.rng.Uint32())
141+
clusterName := fmt.Sprintf("cluster-%s", randutil.RandString(t.rng, 10, randutil.PrintableKeyAlphabet))
142142
c := &SyncedCluster{
143143
Cluster: cloud.Cluster{
144144
Name: clusterName,

0 commit comments

Comments
 (0)