Merge pull request #12611 from ptabor/20210111-fix-flakes

e2e tests flakes & leaks fixes: In particular TestIssue6361
This commit is contained in:
Jingyi Hu
2021-01-12 21:26:54 +08:00
committed by GitHub
16 changed files with 85 additions and 54 deletions

View File

@@ -18,7 +18,6 @@ import (
"reflect"
"testing"
"time"
"unsafe"
"go.etcd.io/etcd/pkg/v3/testutil"
)
@@ -102,7 +101,7 @@ func TestNodeExternClone(t *testing.T) {
}
func sameSlice(a, b []*NodeExtern) bool {
ah := (*reflect.SliceHeader)(unsafe.Pointer(&a))
bh := (*reflect.SliceHeader)(unsafe.Pointer(&b))
return *ah == *bh
va := reflect.ValueOf(a)
vb := reflect.ValueOf(b)
return va.Len() == vb.Len() && va.Pointer() == vb.Pointer()
}