Repository navigation
Description
Description
Five external-scan compiler unit tests depend on the host's scheduling capacity instead of declaring the logical topology their assertions require. With GOMAXPROCS=2, the current main fails these tests even though the compiler correctly respects the supplied capacity. This prevents bounded local validation and makes the tests depend on runner resources.
Reproduction
Verified on a clean detached main worktree at 52904d5ab275d407dd0baf539eb16d2411fa2d5e, Go 1.26.4, Linux, with existing native artifacts:
GOMAXPROCS=2 GOMEMLIMIT=2GiB \
.agents/skills/mo-dev/scripts/mo-cgo-test -p=1 -parallel=1 -count=1 \
-run '^(TestCompileExternScanMultiFileFanoutCsvLoad|TestCompileExternScanMultiFileFanoutExternalTable|TestCompileExternScanParquetLoadUsesRowGroupMetadata|TestCompileExternScanParquetLoadUsesRowGroupFanoutWithEmptyFiles|TestCompileExternScanParquetRowGroupFanoutValidatesEmptyFileColumnCount)$' \
./pkg/sql/compileAll five selected tests fail at runtime (not compilation). The same five failures occur in the complete compile-package run on the cleanup branch.
Root cause
NewMockCompile initializes Compile.ncpu from system.GoMaxProcs(). The fanout tests never set the capacity required by their independent assertions:
- The CSV, external-table and single-Parquet cases expect three independent scopes, but the compiler correctly produces two when the local capacity is two.
- The two empty-file Parquet cases need spare capacity beyond two matched files to reach footer/row-group planning. At capacity two,
parquetLoadFileFanoutSaturatescorrectly chooses whole-file fanout, so the tests no longer reach their metadata and schema-validation assertions.
Expected fix
Declare the required logical compiler capacity in each affected fixture using the existing Compile.ncpu field. Keep the host process CPU limit at two, retain all file/row-group coverage and exact error assertions, and verify normal/race execution. Do not increase global GOMAXPROCS, skip tests, weaken expected results, add fallback behavior, or change production scheduling to accommodate the test.
This issue concerns deterministic test setup; these failures do not establish a production query or data correctness regression.
Activity
refactor(test): make planner fixture ownership explicit (#29638)
fix(plan): preserve grouping-extension CTAS semantics on 4.1.6-hotfix (…