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 flaky unit tests #2904

Merged
merged 2 commits into from
Dec 6, 2022
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
3 changes: 2 additions & 1 deletion pkg/controller/operators/olm/operator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3923,9 +3923,10 @@ func TestUpdates(t *testing.T) {
simulateSuccessfulRollout(current, op.opClient)
}
for current.Status.Phase != e.whenIn.phase {
fmt.Printf("waiting for (when) %s to be %s\n", e.whenIn.name, e.whenIn.phase)
csvsToSync = syncCSVs(csvsToSync, deletedCSVs(e.shouldBe))
current = csvsToSync[e.whenIn.name]
fmt.Printf("waiting for (when) %s to be %s\n", e.whenIn.name, e.whenIn.phase)
time.Sleep(1 * time.Millisecond)
}

// sync the other csvs until they're in the expected status
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/registry/resolver/step_resolver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1182,7 +1182,7 @@ func TestResolver(t *testing.T) {
steps: [][]*v1alpha1.Step{},
subs: []*v1alpha1.Subscription{},
errAssert: func(t *testing.T, err error) {
assert.Contains(t, err.Error(), "failed to populate resolver cache from source @existing/catsrc-namespace: csv catsrc-namespace/a.v1")
assert.Contains(t, err.Error(), "failed to populate resolver cache from source @existing/catsrc-namespace: csv")
assert.Contains(t, err.Error(), "in phase Failed instead of Replacing")
},
},
Expand Down