Skip to content
This repository has been archived by the owner on Mar 16, 2024. It is now read-only.

Commit

Permalink
Fix test flake when project doesn't support region
Browse files Browse the repository at this point in the history
We have seen a few flakes regarding projects not supporting regions.
This seems to be because the app goes through the controller before the
project completes. This change will ensure the project default region is
set before returning the project.

Signed-off-by: Donnie Adams <[email protected]>
  • Loading branch information
thedadams committed Jul 17, 2023
1 parent ffbc1ef commit b5e261b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions integration/helper/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ func TempProject(t *testing.T, client client.WithWatch) *v1.ProjectInstance {
return obj.Name == project.Name
})

// Wait for status default region to be set...
WaitForObject(t, client.Watch, &v1.ProjectInstanceList{}, project, func(obj *v1.ProjectInstance) bool {
return obj.Status.DefaultRegion == obj.Spec.DefaultRegion
})

t.Cleanup(func() {
err = client.Delete(ctx, project)
if err != nil {
Expand Down

0 comments on commit b5e261b

Please sign in to comment.