Skip to content

Commit c6a7ed7

Browse files
fix: use WithContext for gomega Eventually/Consistently
- Change gomega.Eventually(ctx, actual, intervals...) to gomega.Eventually(actual, intervals...).WithContext(ctx) - Change gomega.Consistently(ctx, actual, intervals...) to gomega.Consistently(actual, intervals...).WithContext(ctx) - Fix return type from ConsistentlyAssertion to AsyncAssertion The previous syntax was not supported by the current gomega API.
1 parent f81e1e5 commit c6a7ed7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/pkg/environment/common/environment.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,11 @@ func (env *Environment) ResetContext() {
102102
}
103103

104104
func (env *Environment) Eventually(actual interface{}, intervals ...interface{}) gomega.AsyncAssertion {
105-
return gomega.Eventually(env.Context, actual, intervals...)
105+
return gomega.Eventually(actual, intervals...).WithContext(env.Context)
106106
}
107107

108-
func (env *Environment) Consistently(actual interface{}, intervals ...interface{}) gomega.ConsistentlyAssertion {
109-
return gomega.Consistently(env.Context, actual, intervals...)
108+
func (env *Environment) Consistently(actual interface{}, intervals ...interface{}) gomega.AsyncAssertion {
109+
return gomega.Consistently(actual, intervals...).WithContext(env.Context)
110110
}
111111

112112
func NewConfig() *rest.Config {

0 commit comments

Comments
 (0)