From 4f44de8ee0ec51ee5c934048405030e362cc197f Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Tue, 2 Jun 2026 21:32:47 +0300 Subject: test(integration): add cachestat end-to-end coverage cachestat(2) had no integration coverage. Add a readwrite-cachestat ioworkload scenario and TestReadwriteCachestat mirroring the readahead precedent: open a temp file, write data to populate the page cache, then issue cachestat via a raw syscall (no glibc/unix wrapper) with a whole-file cachestat_range and zeroed cachestat output buffer, flags=0. ENOSYS on kernels < 6.5 is tolerated for portability. The test asserts enter_cachestat is captured with the fd-resolved file path, that the UNCLASSIFIED return attributes zero bytes, and that the syscall duration is positive. golang.org/x/sys is promoted to a direct dependency. Verified PASS under sudo on kernel 7.0.9. Co-Authored-By: Claude Opus 4.8 --- go.mod | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'go.mod') diff --git a/go.mod b/go.mod index 7e68ecd..c9c4f0c 100644 --- a/go.mod +++ b/go.mod @@ -12,6 +12,8 @@ require ( github.com/charmbracelet/x/term v0.2.2 github.com/magefile/mage v1.15.0 github.com/parquet-go/parquet-go v0.29.0 + golang.org/x/sync v0.19.0 + golang.org/x/sys v0.41.0 ) require ( @@ -35,7 +37,5 @@ require ( github.com/rivo/uniseg v0.4.7 // indirect github.com/twpayne/go-geom v1.6.1 // indirect github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect - golang.org/x/sync v0.19.0 // indirect - golang.org/x/sys v0.41.0 // indirect google.golang.org/protobuf v1.34.2 // indirect ) -- cgit v1.2.3