Merge pull request #13807 from endocrimes/dani/before-test-fix

tests/framework/integration: Fail BeforeTest nesting early
This commit is contained in:
Marek Siarkowicz
2022-04-07 15:37:06 +02:00
committed by GitHub

View File

@@ -72,6 +72,10 @@ func BeforeTest(t testutil.TB, opts ...TestOption) {
t.Helper()
options := newTestOptions(opts...)
if insideTestContext {
t.Fatal("already in test context. BeforeTest was likely already called")
}
if options.skipInShort {
testutil.SkipTestIfShortMode(t, "Cannot create clusters in --short tests")
}
@@ -93,10 +97,6 @@ func BeforeTest(t testutil.TB, opts ...TestOption) {
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")))
insideTestContext = true