test(bigtable): randomize app profile names to avoid test collision
@@ -2207,11 +2207,15 @@ func TestIntegration_InstanceAdminClient_AppProfile(t *testing.T) {
return
}
- err = iAdminClient.DeleteAppProfile(ctx, adminClient.instance, "app_profile1")
+ uniqueID := make([]byte, 4)
+ _, err = rand.Read(uniqueID)
+ profileID := fmt.Sprintf("app_profile%x", uniqueID)
+
+ err = iAdminClient.DeleteAppProfile(ctx, adminClient.instance, profileID)
defer iAdminClient.Close()
profile := ProfileConf{
- ProfileID: "app_profile1",
+ ProfileID: profileID,
InstanceID: adminClient.instance,
ClusterID: testEnv.Config().Cluster,
Description: "creating new app profile 1",
@@ -2223,7 +2227,7 @@ func TestIntegration_InstanceAdminClient_AppProfile(t *testing.T) {
t.Fatalf("Creating app profile: %v", err)
}
- gotProfile, err := iAdminClient.GetAppProfile(ctx, adminClient.instance, "app_profile1")
+ gotProfile, err := iAdminClient.GetAppProfile(ctx, adminClient.instance, profileID)
if err != nil {
t.Fatalf("Get app profile: %v", err)
}
@@ -2298,7 +2302,7 @@ func TestIntegration_InstanceAdminClient_AppProfile(t *testing.T) {
},
},
} {
- err = iAdminClient.UpdateAppProfile(ctx, adminClient.instance, "app_profile1", test.uattrs)
+ err = iAdminClient.UpdateAppProfile(ctx, adminClient.instance, profileID, test.uattrs)
if err != nil {
if test.want != nil {
t.Errorf("%s: %v", test.desc, err)
@@ -2310,7 +2314,7 @@ func TestIntegration_InstanceAdminClient_AppProfile(t *testing.T) {
continue
}
- got, _ := iAdminClient.GetAppProfile(ctx, adminClient.instance, "app_profile1")
+ got, _ := iAdminClient.GetAppProfile(ctx, adminClient.instance, profileID)
if !proto.Equal(got, test.want) {
t.Fatalf("%s : got profile : %v, want profile: %v", test.desc, gotProfile, test.want)
@@ -2318,7 +2322,7 @@ func TestIntegration_InstanceAdminClient_AppProfile(t *testing.T) {
}
- err = iAdminClient.DeleteAppProfile(ctx, adminClient.instance, "app_profile1")
+ err = iAdminClient.DeleteAppProfile(ctx, adminClient.instance, profileID)
if err != nil {
t.Fatalf("Delete app profile: %v", err)
}
