mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #13807 from endocrimes/dani/before-test-fix
tests/framework/integration: Fail BeforeTest nesting early
This commit is contained in:
commit
a5b9f72da6
@ -72,6 +72,10 @@ func BeforeTest(t testutil.TB, opts ...TestOption) {
|
|||||||
t.Helper()
|
t.Helper()
|
||||||
options := newTestOptions(opts...)
|
options := newTestOptions(opts...)
|
||||||
|
|
||||||
|
if insideTestContext {
|
||||||
|
t.Fatal("already in test context. BeforeTest was likely already called")
|
||||||
|
}
|
||||||
|
|
||||||
if options.skipInShort {
|
if options.skipInShort {
|
||||||
testutil.SkipTestIfShortMode(t, "Cannot create clusters in --short tests")
|
testutil.SkipTestIfShortMode(t, "Cannot create clusters in --short tests")
|
||||||
}
|
}
|
||||||
@ -93,10 +97,6 @@ func BeforeTest(t testutil.TB, opts ...TestOption) {
|
|||||||
os.Chdir(previousWD)
|
os.Chdir(previousWD)
|
||||||
})
|
})
|
||||||
|
|
||||||
if insideTestContext {
|
|
||||||
t.Fatal("already in test context. BeforeTest was likely already called")
|
|
||||||
}
|
|
||||||
|
|
||||||
grpc_logger.Set(zapgrpc.NewLogger(zaptest.NewLogger(t).Named("grpc")))
|
grpc_logger.Set(zapgrpc.NewLogger(zaptest.NewLogger(t).Named("grpc")))
|
||||||
insideTestContext = true
|
insideTestContext = true
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user