kubernetes/test/utils/ktesting/examples/with_ktesting
Patrick Ohly 65693b2d2a ktesting: fix setting up progress reporting
The recent change to support importing ktesting into an E2E suite
without progress reporting was flawed:
- If a Go unit test had a deadline (the default when invoked
  by `go test`!), the early return skipped initializing progress
  reporting.
- When it didn't, for example when invoking a test binary directly
  under stress, a test created goroutines which were kept running,
  which broke leak checking in e.g. an integration tests TestMain.

The revised approach uses reference counting: as long as some unit test is
running, the progress reporting with the required goroutines are active.
When the last one ends, they get cleaned up, which keeps the goleak
checker happy.
2026-01-27 10:13:43 +01:00
..
doc.go ktesting: add TContext 2024-02-11 10:51:38 +01:00
example_test.go ktesting: fix setting up progress reporting 2026-01-27 10:13:43 +01:00