mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Verification framework and check whether cindex is not decreasing.
This commit is contained in:
@@ -21,9 +21,9 @@ import (
|
||||
|
||||
grpc_logsettable "github.com/grpc-ecosystem/go-grpc-middleware/logging/settable"
|
||||
"go.etcd.io/etcd/client/pkg/v3/testutil"
|
||||
"go.etcd.io/etcd/client/pkg/v3/verify"
|
||||
clientv3 "go.etcd.io/etcd/client/v3"
|
||||
"go.etcd.io/etcd/server/v3/embed"
|
||||
"go.etcd.io/etcd/server/v3/verify"
|
||||
"go.uber.org/zap/zapcore"
|
||||
"go.uber.org/zap/zapgrpc"
|
||||
"go.uber.org/zap/zaptest"
|
||||
@@ -90,18 +90,20 @@ func BeforeTest(t testutil.TB, opts ...TestOption) {
|
||||
}
|
||||
previousInsideTestContext := insideTestContext
|
||||
|
||||
// Integration tests should verify written state as much as possible.
|
||||
revertFunc := verify.EnableAllVerifications()
|
||||
|
||||
// Registering cleanup early, such it will get executed even if the helper fails.
|
||||
t.Cleanup(func() {
|
||||
grpc_logger.Reset()
|
||||
insideTestContext = previousInsideTestContext
|
||||
os.Chdir(previousWD)
|
||||
revertFunc()
|
||||
})
|
||||
|
||||
grpc_logger.Set(zapgrpc.NewLogger(zaptest.NewLogger(t).Named("grpc")))
|
||||
insideTestContext = true
|
||||
|
||||
// Integration tests should verify written state as much as possible.
|
||||
os.Setenv(verify.ENV_VERIFY, verify.ENV_VERIFY_ALL_VALUE)
|
||||
os.Chdir(t.TempDir())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user