fix(verify): fix flaky JIT tests with global buffers and KeepAlive
Test / vet (push) Successful in 49s
Test / test (push) Failing after 2m9s
Test / build (push) Skipped

This commit is contained in:
2026-08-05 23:09:54 +02:00
parent 23b3d3e152
commit 19b37569c0
10 changed files with 323 additions and 38 deletions
+3 -2
View File
@@ -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 == "" {