mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Embed: In case KVStoreHash verification fails, close the backend.
In case of failed verification, the server used to keep opened backend (so the file was locked on OS level).
This commit is contained in:
@@ -110,8 +110,12 @@ func BeforeTest(t TB) {
|
||||
// It will detect common goroutine leaks, retrying in case there are goroutines
|
||||
// not synchronously torn down, and fail the test if any goroutines are stuck.
|
||||
func AfterTest(t TB) {
|
||||
if err := CheckAfterTest(1 * time.Second); err != nil {
|
||||
t.Errorf("Test %v", err)
|
||||
// If test-failed the leaked goroutines list is hidding the real
|
||||
// source of problem.
|
||||
if !t.Failed() {
|
||||
if err := CheckAfterTest(1 * time.Second); err != nil {
|
||||
t.Errorf("Test %v", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -53,8 +53,9 @@ func MustNewURL(t *testing.T, s string) *url.URL {
|
||||
func FatalStack(t *testing.T, s string) {
|
||||
stackTrace := make([]byte, 1024*1024)
|
||||
n := runtime.Stack(stackTrace, true)
|
||||
t.Errorf("---> Test failed: %s", s)
|
||||
t.Error(string(stackTrace[:n]))
|
||||
t.Fatalf(s)
|
||||
t.Fatal(s)
|
||||
}
|
||||
|
||||
// ConditionFunc returns true when a condition is met.
|
||||
|
||||
Reference in New Issue
Block a user