fix(verify): fix flaky JIT tests with global buffers and KeepAlive
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
package verify
|
||||
|
||||
import (
|
||||
"runtime"
|
||||
"testing"
|
||||
"unsafe"
|
||||
)
|
||||
@@ -100,6 +101,8 @@ func TestABILZ4Kernels(t *testing.T) {
|
||||
PutUint64(args, 40, 128)
|
||||
|
||||
_, report, err := k.CallFuncChecked("wideCopyAVX2", args)
|
||||
runtime.KeepAlive(dst)
|
||||
runtime.KeepAlive(src)
|
||||
if err != nil {
|
||||
t.Fatalf("CallFuncChecked(wideCopyAVX2): %v", err)
|
||||
}
|
||||
@@ -120,6 +123,8 @@ func TestABILZ4Kernels(t *testing.T) {
|
||||
PutUint64(decArgs, 40, uint64(cap(decDst)))
|
||||
|
||||
_, report, err = k.CallFuncChecked("decodeBlockAVX2", decArgs)
|
||||
runtime.KeepAlive(decSrc)
|
||||
runtime.KeepAlive(decDst)
|
||||
if err != nil {
|
||||
t.Fatalf("CallFuncChecked(decodeBlockAVX2): %v", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user