File tree Expand file tree Collapse file tree
trunk/google-cloud-spanner/src/main/java/com/google/cloud/spanner/testing Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11---
2- refs/heads/master: 5311bb39021f97722bd8a549ed703e4c3d9b7c66
2+ refs/heads/master: 6cc0615aefe22fd2ed394b906ae4c9cfb77170af
33refs/heads/travis: dae77e558b884bc1b165155482d76c8e40b0fca4
44refs/heads/gh-pages: 229631582f8957646f81e92ae5a326504f48ee5b
55refs/tags/0.0.9: 22f1839238f66c39e67ed4dfdcd273b1ae2e8444
Original file line number Diff line number Diff line change 2727import java .util .ArrayList ;
2828import java .util .Arrays ;
2929import java .util .List ;
30+ import java .util .Random ;
3031import java .util .logging .Level ;
3132import java .util .logging .Logger ;
3233
@@ -41,6 +42,7 @@ public class RemoteSpannerHelper {
4142 private final Spanner client ;
4243 private final InstanceId instanceId ;
4344 private static int dbSeq ;
45+ private static int dbPrefix = new Random ().nextInt (Integer .MAX_VALUE );
4446 private final List <Database > dbs = new ArrayList <>();
4547
4648 private RemoteSpannerHelper (SpannerOptions options , InstanceId instanceId , Spanner client ) {
@@ -78,7 +80,7 @@ public Database createTestDatabase(String... statements) throws SpannerException
7880 * Returns a database id which is guaranteed to be unique within the context of this environment.
7981 */
8082 public String getUniqueDatabaseId () {
81- return String .format ("testdb_%04d" , dbSeq ++);
83+ return String .format ("testdb_%d_% 04d" , dbPrefix , dbSeq ++);
8284 }
8385
8486 /**
You can’t perform that action at this time.
0 commit comments