Disable morph logging in NewTestPool (#36308)

Every test binary that uses TestPool builds 16 stores in parallel, each
running the full migration set. Without DisableMorphLogging() the morph
debug stream from each store flows through to the test logger (which is
configured at LvlTrace), producing tens of thousands of "migrating (up)"
lines per shard — amplified further on shards that re-run flaky tests,
since every re-run spawns a fresh TestMain and a fresh pool.

Migration failures are still surfaced: engine.ApplyAll returns the
error, sqlstore.New wraps it as "failed to apply database migrations",
and both NewTestPool callers panic on a non-nil result.

Co-authored-by: Mattermost Build <build@mattermost.com>
This commit is contained in:
Jesse Hallam
2026-04-30 17:28:50 +02:00
committed by GitHub
co-authored by Mattermost Build
parent e70e8c0e9e
commit cad4a4509c
+1 -1
View File
@@ -38,7 +38,7 @@ func NewTestPool(logger mlog.LoggerIFace, driverName string, poolSize int) (*Tes
settings := storetest.MakeSqlSettings(driverName)
sqlStore, err := New(*settings, logger, nil, WithFeatureFlags(func() *model.FeatureFlags {
return &model.FeatureFlags{CJKSearch: true}
}))
}), DisableMorphLogging())
if err != nil {
return err
}