Skip to content

Commit 69fcab1

Browse files
authored
Fix/480 1611 (#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

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

assert/assert_assertions.go

Lines changed: 55 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assert/assert_assertions_test.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assert/assert_examples_test.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assert/assert_format.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assert/assert_format_test.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assert/assert_forward.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assert/assert_forward_test.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assert/assert_helpers.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assert/assert_helpers_test.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assert/assert_types.go

Lines changed: 5 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)