Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix waitPoolRunningIdleInstances function #168

Merged
merged 1 commit into from
Aug 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions test/integration/e2e/instances.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,11 @@ func waitPoolRunningIdleInstances(poolID string, timeout time.Duration) error {
poolInstances = make(params.Instances, 0)
runningIdleCount := 0
for _, instance := range instances {
if instance.PoolID == poolID {
poolInstances = append(poolInstances, instance)
if instance.PoolID != poolID {
continue
}
// current instance belongs to the pool we are waiting for
poolInstances = append(poolInstances, instance)
if instance.Status == commonParams.InstanceRunning && instance.RunnerStatus == params.RunnerIdle {
runningIdleCount++
}
Expand Down
4 changes: 2 additions & 2 deletions test/integration/e2e/organizations.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,8 @@ func WaitOrgRunningIdleInstances(orgID string, timeout time.Duration) {
}

func dumpOrgInstancesDetails(orgID string) error {
log.Printf("Dumping org %s instances details", orgID)

// print org details
log.Printf("Dumping org %s details", orgID)
org, err := getOrg(cli, authToken, orgID)
if err != nil {
return err
Expand All @@ -114,6 +113,7 @@ func dumpOrgInstancesDetails(orgID string) error {
}

// print org instances details
log.Printf("Dumping org %s instances details", orgID)
instances, err := listOrgInstances(cli, authToken, orgID)
if err != nil {
return err
Expand Down
4 changes: 2 additions & 2 deletions test/integration/e2e/repositories.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,8 @@ func WaitRepoRunningIdleInstances(repoID string, timeout time.Duration) {
}

func dumpRepoInstancesDetails(repoID string) error {
log.Printf("Dumping repo %s instances details", repoID)

// print repo details
log.Printf("Dumping repo %s details", repoID)
repo, err := getRepo(cli, authToken, repoID)
if err != nil {
return err
Expand All @@ -115,6 +114,7 @@ func dumpRepoInstancesDetails(repoID string) error {
}

// print repo instances details
log.Printf("Dumping repo %s instances details", repoID)
instances, err := listRepoInstances(cli, authToken, repoID)
if err != nil {
return err
Expand Down