Skip to content

Load test framework doesn't use pagination when calling instanceGroupManagers.listManagedInstances #336

@matt-kwong

Description

@matt-kwong

InstanceGroupManagersListManagedInstancesResponse response;
while (true) {
try {
response =
compute
.instanceGroupManagers()
.listManagedInstances(project, params.getZone(), instanceName())
.execute();
} catch (GoogleJsonResponseException e) {
log.warn("Unable to fetch response: ", e);
continue;
}
if (response != null) {
if (response.getManagedInstances() != null) {
if (response.getManagedInstances().stream()
.allMatch(i -> "RUNNING".equals(i.getInstanceStatus()))) {
break;
}
}
}
log.warn("Instances not yet ready: " + (response == null ? "null" : response));
Thread.sleep(10000);
}

By default, instanceGroupManagers.listManagedInstances returns 500 results. If someone were to run the load test framework with publisher workers + subscriber workers > 500, then it's possible for the load test to start without all GCE instances ready to run (there's probably other issues as well).

This is probably not a big deal unless users are trying to run very expensive load tests with this framework.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions