From 54e66e776da8ec70a1a39d813907d00f43ba8329 Mon Sep 17 00:00:00 2001 From: Martin Hutchinson Date: Fri, 6 Nov 2026 15:20:58 +0000 Subject: [PATCH 1/2] ci: drop -v from go test in workflows Running go test with -v across ./... streams logs from all passing packages (over 50k lines), burying actual test failures. Without -v, go test buffers output per package and prints full logs only for packages that fail. --- .github/workflows/go_test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/go_test.yml b/.github/workflows/go_test.yml index 46ba1d3f6..c5b980800 100644 --- a/.github/workflows/go_test.yml +++ b/.github/workflows/go_test.yml @@ -25,7 +25,7 @@ jobs: go-version: ${{ matrix.go-version }} - name: Run tests - run: go test -v -race ./... + run: go test -race ./... test-aws-mysql: runs-on: ubuntu-latest @@ -54,4 +54,4 @@ jobs: persist-credentials: false - name: Test with Go # Parallel tests are disabled for the MySQL test database to always be in a known state. - run: go test -p=1 -v -race ./storage/aws/... -is_mysql_test_optional=false + run: go test -p=1 -race ./storage/aws/... -is_mysql_test_optional=false From 02284f6f13bfe74d757219d3d6aa2039bf3f83f8 Mon Sep 17 00:00:00 2001 From: Martin Hutchinson Date: Fri, 6 Nov 2026 15:39:01 +0000 Subject: [PATCH 2/2] test: stop POSIX background jobs before TempDir cleanup Cancel the appender context on test log shutdown and before final fsck in POSIX GC tests, and drop the unnecessary 100ms checkpoint republish interval in TestGateway so background checkpoint/GC tickers do not race with t.TempDir() os.RemoveAll cleanup. --- internal/mirror/gateway/mirror_gateway_test.go | 3 +-- storage/posix/files_test.go | 14 ++++++++++++-- testonly/testlog.go | 12 +++++++++--- 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/internal/mirror/gateway/mirror_gateway_test.go b/internal/mirror/gateway/mirror_gateway_test.go index 0ff57af0b..191226da1 100644 --- a/internal/mirror/gateway/mirror_gateway_test.go +++ b/internal/mirror/gateway/mirror_gateway_test.go @@ -56,8 +56,7 @@ func TestGateway(t *testing.T) { } { t.Run(tc.name, func(t *testing.T) { opts := tessera.NewAppendOptions(). - WithCheckpointInterval(100 * time.Millisecond). - WithCheckpointRepublishInterval(100 * time.Millisecond) + WithCheckpointInterval(100 * time.Millisecond) testLog, shutdown := testonly.NewTestLog(t, opts) defer func() { diff --git a/storage/posix/files_test.go b/storage/posix/files_test.go index 2960d982a..9711de44c 100644 --- a/storage/posix/files_test.go +++ b/storage/posix/files_test.go @@ -38,6 +38,8 @@ import ( func TestGarbageCollect(t *testing.T) { ctx := t.Context() + appCtx, cancel := context.WithCancel(ctx) + defer cancel() batchSize := uint64(60000) integrateEvery := uint64(31343) @@ -59,7 +61,7 @@ func TestGarbageCollect(t *testing.T) { s: s, entriesPath: opts.EntriesPath(), } - appender, lr, err := s.newAppender(ctx, logStorage, opts) + appender, lr, err := s.newAppender(appCtx, logStorage, opts) if err != nil { t.Fatalf("Appender: %v", err) } @@ -113,6 +115,9 @@ func TestGarbageCollect(t *testing.T) { } } + // Stop background appender jobs before running fsck and TempDir cleanup. + cancel() + // And finally, for good measure, assert that all the resources implied by the log's checkpoint // are present. f := fsck.New(vk.Name(), vk, lr, defaultMerkleLeafHasher, fsck.Opts{N: 1}) @@ -149,6 +154,8 @@ func TestGarbageCollectOption(t *testing.T) { } { t.Run(test.name, func(t *testing.T) { ctx := t.Context() + appCtx, cancel := context.WithCancel(ctx) + defer cancel() s := &Storage{ cfg: Config{ @@ -172,7 +179,7 @@ func TestGarbageCollectOption(t *testing.T) { s: s, entriesPath: opts.EntriesPath(), } - appender, lr, err := s.newAppender(ctx, logStorage, opts) + appender, lr, err := s.newAppender(appCtx, logStorage, opts) if err != nil { t.Fatalf("Appender: %v", err) } @@ -240,6 +247,9 @@ func TestGarbageCollectOption(t *testing.T) { } } + // Stop background appender jobs before running fsck and TempDir cleanup. + cancel() + // And finally, for good measure, assert that all the resources implied by the log's checkpoint // are present. f := fsck.New(vk.Name(), vk, lr, defaultMerkleLeafHasher, fsck.Opts{N: 1}) diff --git a/testonly/testlog.go b/testonly/testlog.go index 06830eb25..88f852bb8 100644 --- a/testonly/testlog.go +++ b/testonly/testlog.go @@ -46,13 +46,16 @@ func NewTestLog(t *testing.T, opts *tessera.AppendOptions) (*TestLog, func(conte } root := t.TempDir() - driver, err := posix.New(t.Context(), posix.Config{Path: root}) + ctx, cancel := context.WithCancel(t.Context()) + t.Cleanup(cancel) + + driver, err := posix.New(ctx, posix.Config{Path: root}) if err != nil { t.Fatalf("posix.New: %v", err) } opts.WithCheckpointSigner(s) - a, shutdown, lr, err := tessera.NewAppender(t.Context(), driver, opts) + a, shutdown, lr, err := tessera.NewAppender(ctx, driver, opts) if err != nil { t.Fatalf("NewAppender: %v", err) } @@ -64,7 +67,10 @@ func NewTestLog(t *testing.T, opts *tessera.AppendOptions) (*TestLog, func(conte Appender: a, } - return r, shutdown + return r, func(sCtx context.Context) error { + defer cancel() + return shutdown(sCtx) + } } // TestLog represents an ephemeral POSIX log instance intended for use in tests.