cloud-bulldozer / ocm-api-load

A set of load tests for OCM's clusters-service, based on vegeta.
Apache License 2.0
1 stars 8 forks source link

patch-services test failing #91

Open venkataanil opened 2 years ago

venkataanil commented 2 years ago

patch-services test failing with below error 2022/11/17 14:49:00 Fatal - Unable to create Service: %!(EXTRA *errors.Error=status is 502, identifier is '24', code is 'OCM-MS-24' and operation identifier is '2HgAq3EOffKnOrllJyqV5WrNrC3': Unable to create cluster : status is 400, identifier is '400', code is 'CLUSTERS-MGMT-400' and operation identifier is 'ded178cd-27d6-4ca1-83d3-e477a3603753': Could not find provided zone 'us-west-2' in the AWS Region: 'us-west-2')

Below fixes needed in https://github.com/cloud-bulldozer/ocm-api-load/blob/main/pkg/tests/handlers/services.go

  1. Append 'a' to region while creating the cluster i.e

    • Nodes(v1.NewClusterNodes().AvailabilityZones(ccsRegion)).
    • Nodes(v1.NewClusterNodes().AvailabilityZones(fmt.Sprintf("%sa", ccsRegion))).
  2. Use ServiceID instead of ClusterID in patch path

    • serviceIds[i] = clusterID
    • serviceIds[i] = serviceID
  3. As we are creating 2 clusters for patching, we should append iterator number (i.e i ) in cluster name rather than 'idx', which is always 0 (to avoid creating duplicate cluster)

    • Name(fmt.Sprintf("perf-%s-%d", id, idx)).
    • Name(fmt.Sprintf("perf-%s-%d", id, i)).
  4. fakeClusterProps are overriden by rosaCreatorProps while passing it to cluster create method. So better merge fakeClusterProps inside rosaCreatorProps instead of passing "Properties" twice . Cluster(v1.NewCluster(). Name(fmt.Sprintf("perf-%s-%d", id, idx)). AWS( v1.NewAWS(). AccessKeyID(ccsAccessKey). SecretAccessKey(ccsSecretKey). AccountID(ccsAccountID), ). Nodes(v1.NewClusterNodes().AvailabilityZones(fmt.Sprintf("%sa", ccsRegion))). Properties(fakeClusterProps). Properties(rosaCreatorProps). Region(v1.NewCloudRegion().ID(ccsRegion))).

  5. Avoid passing service and cluster arguments for PATCH method as ocm-managed-services validations are not accepting them i.e only pass Parameters body, err := v1.NewManagedService(). Parameters(v1.NewServiceParameter().ID("has-external-resources").Value("false")). Build()

However after all these changes, patching is failing as patching is allowed only when service is in "waiting for addon" state. But our service is stuck in 'waiting for cluster' state as cluster is a fake-cluster and will be in always in "installing" state. We also can't patch cluster state as ocm validations won't allow it. We need to check with ocm team regarding this issue.

venkataanil commented 2 years ago

After fakeClusterProps properly passed i.e step 4 above, cluster is moved to "ready" state and service is moved to 'waiting for addon'. So now we can patch the service and no need to talk to ocm team :)

venkataanil commented 2 years ago

Fix https://github.com/cloud-bulldozer/ocm-api-load/pull/93 proposed