Minor cleanup in etcd3 tests

This commit is contained in:
Wojciech Tyczyński 2022-10-31 18:02:40 +01:00
parent e6ddb69e6f
commit 83399ccfb8

View File

@ -27,7 +27,6 @@ import (
"k8s.io/apiserver/pkg/storage"
"k8s.io/apiserver/pkg/storage/etcd3/testserver"
storagetesting "k8s.io/apiserver/pkg/storage/testing"
)
func TestWatch(t *testing.T) {
@ -62,6 +61,32 @@ func TestWatchContextCancel(t *testing.T) {
storagetesting.RunTestWatchContextCancel(ctx, t, store)
}
func TestWatchDeleteEventObjectHaveLatestRV(t *testing.T) {
ctx, store, _ := testSetup(t)
storagetesting.RunTestWatchDeleteEventObjectHaveLatestRV(ctx, t, store)
}
func TestWatchInitializationSignal(t *testing.T) {
ctx, store, _ := testSetup(t)
storagetesting.RunTestWatchInitializationSignal(ctx, t, store)
}
func TestProgressNotify(t *testing.T) {
clusterConfig := testserver.NewTestConfig(t)
clusterConfig.ExperimentalWatchProgressNotifyInterval = time.Second
ctx, store, _ := testSetup(t, withClientConfig(clusterConfig))
storagetesting.RunOptionalTestProgressNotify(ctx, t, store)
}
// =======================================================================
// Implementation-specific tests are following.
// The following tests are exercising the details of the implementation
// not the actual user-facing contract of storage interface.
// As such, they may focus e.g. on non-functional aspects like performance
// impact.
// =======================================================================
func TestWatchErrResultNotBlockAfterCancel(t *testing.T) {
origCtx, store, _ := testSetup(t)
ctx, cancel := context.WithCancel(origCtx)
@ -83,21 +108,3 @@ func TestWatchErrResultNotBlockAfterCancel(t *testing.T) {
cancel()
wg.Wait()
}
func TestWatchDeleteEventObjectHaveLatestRV(t *testing.T) {
ctx, store, _ := testSetup(t)
storagetesting.RunTestWatchDeleteEventObjectHaveLatestRV(ctx, t, store)
}
func TestWatchInitializationSignal(t *testing.T) {
ctx, store, _ := testSetup(t)
storagetesting.RunTestWatchInitializationSignal(ctx, t, store)
}
func TestProgressNotify(t *testing.T) {
clusterConfig := testserver.NewTestConfig(t)
clusterConfig.ExperimentalWatchProgressNotifyInterval = time.Second
ctx, store, _ := testSetup(t, withClientConfig(clusterConfig))
storagetesting.RunOptionalTestProgressNotify(ctx, t, store)
}