spanner: replace time with the projectID when creating a DB for tests
@@ -19,6 +19,8 @@ import (
)
func TestSample(t *testing.T) {
+ tc := testutil.SystemTest(t)
+
instance := os.Getenv("GOLANG_SAMPLES_SPANNER")
if instance == "" {
t.Skip("Skipping spanner integration test. Set GOLANG_SAMPLES_SPANNER.")
@@ -26,7 +28,7 @@ func TestSample(t *testing.T) {
if !strings.HasPrefix(instance, "projects/") {
t.Fatal("Spanner instance ref must be in the form of 'projects/PROJECT_ID/instances/INSTANCE_ID'")
}
- dbName := fmt.Sprintf("%s/databases/test-%d", instance, time.Now().Unix())
+ dbName := fmt.Sprintf("%s/databases/test-%s", instance, tc.ProjectID)
ctx := context.Background()
adminClient, dataClient := createClients(ctx, dbName)
