fix(verify): fix flaky JIT tests with global buffers and KeepAlive
This commit is contained in:
+3
-2
@@ -7,6 +7,7 @@ import (
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"os"
|
||||
"runtime"
|
||||
|
||||
"sourcedock.dev/petrbalvin/gasm-devkit/asm"
|
||||
"sourcedock.dev/petrbalvin/gasm-devkit/ast"
|
||||
@@ -153,7 +154,7 @@ func (k *Kernel) FuzzFuncChecked(name string, sig funcSig, iterations int, seed
|
||||
if result.FirstFail == "" {
|
||||
result.FirstFail = fmt.Sprintf("iter %d: call: %v", i, err)
|
||||
}
|
||||
releaseBufs(bufs)
|
||||
runtime.KeepAlive(bufs)
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -166,7 +167,7 @@ func (k *Kernel) FuzzFuncChecked(name string, sig funcSig, iterations int, seed
|
||||
} else {
|
||||
result.Matches++
|
||||
}
|
||||
releaseBufs(bufs)
|
||||
runtime.KeepAlive(bufs)
|
||||
}
|
||||
|
||||
if violations > 0 && result.FirstFail == "" {
|
||||
|
||||
Reference in New Issue
Block a user