apisix-ingress-controller icon indicating copy to clipboard operation
apisix-ingress-controller copied to clipboard

test: Remove `time.Sleep` and replace with wait.poll

Open AlinsRan opened this issue 2 years ago • 0 comments

background

In the current project's e2e, a lot of time.sleep is used. This will undoubtedly increase the overall time-consuming of CI.

https://pkg.go.dev/k8s.io/apimachinery/pkg/util/wait package provides tools for polling or listening for changes to a condition.

We can replace the current time.sleep with wait for a more elegant way of determining whether our desired state has been reached.

To do list:

  • [ ] suite-annotations
  • [ ] suite-ingress
    • [x] suite-ingress-resource #1128
    • [ ] suite-ingress-features
  • [ ] suite-plugins
    • [ ] suite-plugins-authentication
    • [ ] suite-plugins-general
    • [ ] suite-plugins-other
    • [ ] suite-plugins-security
    • [ ] suite-plugins-traffic
    • [ ] suite-plugins-transformation
  • [ ] suite-features

AlinsRan avatar Jul 04 '22 03:07 AlinsRan