kubernetes/test/utils/ktesting
Patrick Ohly 03e337cfb7 ktesting: support for synctest
A "sync test" runs the test inside a testing/synctest bubble. Time moves
forward in a deterministic fashion when all goroutines are blocked
waiting for time to progress. This simplifies testing concurrent behavior.

ktesting enables writing such tests with a new SyncTest method: it can start a
new sub-test (similar to Run) or turn an existing test (typically a top-level
Test<something>) into a sync test when no new name is given.

TContext.IsSyncTest can be used to check the mode of the current test, which
may be useful in common helper code.

TContext.Wait directly maps to synctest.Wait.

This new functionality is limited to tests which use an underlying testing.T
instance.
2025-10-28 21:05:56 +01:00
..
examples
initoption
internal
assert.go
assert_test.go
clientcontext.go
contexthelper.go
contexthelper_test.go
doc.go
errorcontext.go
errorcontext_test.go
helper_test.go
klogcontext.go
ktesting.go
main_test.go
signals.go
signals_non_win.go
signals_win.go
stepcontext.go
stepcontext_test.go
tcontext.go
tcontext_test.go
withcontext.go