Skip to content

[Bug]: External scan compiler tests depend on host CPU capacity #29637

Closed

Description

@XuPeng-SH

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/compile

All 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, parquetLoadFileFanoutSaturates correctly 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.

Related cleanup: #29249, #29627, #29629.

Activity

  1. added
    kind/bug
    on Oct 5, 2026
  2. added a commit that references this issue on Oct 6, 2026
    c659910
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions