Commit 69fcab1
authored
Fix/480 1611 (go-openapi#30)
* fix(Eventually): fixed go routine leak issues
Reference (original issue report): stretchr#1611
This fix involves a complete rewrite of assertions that run background
checks, with more idiomatic go routine codes and use of context.Context.
Affected assertions:
* Eventually
* Never
* EventuallyWithT
We no longer run go routines that are not waited for.
Timeouts and early exits are handled via context.Context.
CollecT.FailNow() now also cancels the context of the caller instead.
Significant changes:
* callers should not expect Eventually and others to
complete in the case of a blocking condition function.
In particular, the condition function should never wait for an event that is
triggered after Eventually. Complex or long-running condition function
may use t.Context() to exit early if the test is failed.
* callers may safely assume that only one go routine is executing the
condition function (no race on writes)
* test: asserted stretch/testify#480 is fixed
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
* chore: regenerated packages and docs
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
---------
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>1 parent c217cc4 commit 69fcab1
45 files changed
Lines changed: 1044 additions & 450 deletions
File tree
- assert
- docs/doc-site/api
- internal/assertions
- require
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments