-
-
Notifications
You must be signed in to change notification settings - Fork 288
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
intermediate progress reports for asynchronous assertions (Eventually, Consistently, ...) #574
Comments
See kubernetes/kubernetes#112013 for an implementation outside of ginkgo and gomega. |
hey @pohly first off:
sounds like perhaps the timeout is too high? Is this the sort of case where "usually this passes in 3 seconds, but sometimes it takes 50+ seconds"? If so I'd honestly suggest dropping down the timeout (or making it configurable depending on location (e.g. longer on CI, shorter when running locally) or context (e.g. longer if I'm running lots of specs in parallel and straining a target cluster; shorter if I'm just focusing one spec). In general failing faster seems better to me than adding reporting verbosity. With that said, I can imagine doing what you're asking for like this: gomega.Eventually(func() {...}).WithTimeout(...).WithPolling(...).CallIfStillFailing(func(failure string) {}, 5*time.Second).Should(...) You would then need to supply your own
the reason being that Gomega doesn't know about Ginkgo/GinkgoWriter/By - so you would have to provide that bridge code yourself. I hesitate to add this complexity, though. You could accomplish something similar by adding a |
We have to have very high timeouts in Kubernetes E2E testing because sometimes an operation simply takes longer on a busy cluster. If we make the timeouts too close to what the duration normally is, then we get too many test flakes. I agree that it would be nicer to have better control over the timeouts, but we have too many developers who write tests and not enough reviewers who can check that the tests are written with such issues in mind.
Putting it into the called function means writing extra code, which most developers won't do. We need something very simple. What do you think of the proposal in kubernetes/kubernetes#112013? |
Suppose I have a complex
Eventually
assertion which can block for a long time. When running a test manually, I have to wait for the timeout before there is any indication of what went wrong. If nothing goes wrong, it's not obvious that the test was stuck inEventually
.Example:
One possible solution would be to wrap this in
ginkgo.By
and extendginkgo.By
so that it produces output at regular intervals, similar to the warning about slow tests:Possible output:
The interval for when to print the "still running" part would have to be configurable, similar to
--slow-spec-threshold
:--slow-step-threshold
?That may be a useful enhancement by itself, but doesn't address the "why does it not complete" part. For that, gomega itself would have to have a way to report the intermediate failure. For the special case above, a wrapper around the callback can dump failures at regular intervals, but that is not a generic solution.
The text was updated successfully, but these errors were encountered: